PrepAway - Latest Free Exam Questions & Answers

Tag: Exam 70-515 (update October 26th, 2015)

Exam 70-515: TS: Web Applications Development with Microsoft .NET Framework 4 (update October 26th, 2015)

You need to ensure that Address instances that are serialized by the XmlSerializer class meet the XML format r

You are implementing an ASP.NET Web site. The site contains the following class.
Public Class Address
Public AddressType As Integer
Public Line1 As String
Public Line2 As String
Public City As String
Public ZipPostalCode As String
End Class
The Web site interacts with an external data service that requires Address instances to be given in
the following XML format.
<Address AddressType=”2″>
<Line1>250 Race Court</Line1>
<City>Chicago</City>
<PostalCode>60603</PostalCode>
</Address>
You need to ensure that Address instances that are serialized by the XmlSerializer class meet the
XML format requirements of the external data service. Which two actions should you perform (Each
correct answer presents part of the solution. Choose two.)

You need to ensure that the About action is invoked when the root URL of the site is accessed

You create a new ASP.NET MVC 2 Web application. The following default routes are created in the
Global.
asax.vb file. (Line numbers are included for reference only.) 01 Shared Sub RegisterRoutes(ByVal
routes As
RouteCollection) 03 routes.IgnoreRoute(“{resource}.axd/{*pathInfo}”)
05 routes.MapRoute(_
“Default”,
“{controller}/{action}/{id}”,
New With {.controller = “Home”, .action = “Index”, .id = “”} )
07 End Sub
You implement a controller named HomeController that includes methods with the following
signatures.
Function About() As ActionResult
Function Index() As ActionResult
Function Details(ByVal id As Integer) As ActionResult
You need to ensure that the About action is invoked when the root URL of the site is accessed. What
should you do?

You need to ensure that requests for this URL that contain an unrecognized country value will not be processed

You are implementing an ASP.NET MVC 2 Web application.
The URL with path /Home/Details/{country} will return a page that provides information about the
named country. You need to ensure that requests for this URL that contain an unrecognized country
value will not be processed by the Details action of HomeController. What should you do?

What are two possible ways to achieve this goal?

You are implementing an ASP.NET MVC 2 Web application. A controller contains the following code.
Function Edit(ByVal id As Integer) As ActionResult
Return View(SelectUserToEdit(id))
End Function
Function Edit(ByVal person As Person) As ActionResult
UpdateUser(person)
Return RedirectToAction(“Index”)
End Function
The first Edit action displays the user whose details are to be edited, and the second Edit action is
called when the Save button on the editing form is clicked to update the user details. An exception is
thrown at run time stating that the request for action Edit is ambiguous. You need to correct this
error and ensure that the controller functions as expected. What are two possible ways to achieve
this goal? (Each correct answer presents a complete solution. Choose two.)

You need to resolve the error so that the new view is displayed when the Index method is invoked

You create an ASP.NET MVC 2 Web application that contains the following controller class.
Public Class ProductController
Inherits System.Web.Mvc.Controller
Shared products As List(Of Product) = New List(Of Product)()
Function Index() As ActionResult
Return View()
End Function
End Class
In the Views folder of your application, you add a view page named Index.aspx that includes the
following @ Page directive.
<%@ Page Inherits=”System.Web.Mvc.ViewPage” %>
You test the application with a browser. You receive the following error message when the Index
method is invoked: # The view ‘Index’ or its master was not found.# You need to resolve the error so
that the new view is displayed when the Index method is invoked. What should you do?

Which attribute should you add to the OutputCache directive?

You are developing an ASP.NET Web application. The application will contain a page that is
customized for various browsers. The application will use output cache to optimize performance.
You need to ensure that the page is cached by browser type and major version only. Which attribute
should you add to the OutputCache directive?

You need to ensure that TestPage.aspx can access the CityName property

You are implementing an ASP.NET application that includes a page named TestPage.aspx.
TestPage.aspx uses a master page named TestMaster.master. You add the following code to the
TestPage.aspx code-behind file to read a TestMaster.master public property named CityName.
protected void Page_Load(object sender, EventArgs e)
{
string s = Master.CityName;
}
You need to ensure that TestPage.aspx can access the CityName property. What should you do?


Page 8 of 26« First...678910...20...Last »