PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

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 code segment should you use?

You are maintaining a Windows Communication Foundation (WCF) service that uses a
custom UserNamePassword class to authenticate clients. The service certificate is hosted
in the deployment server store for trusted root certificate authorities and has a Subject value
of TaxServiceKey. Other service certificates hosted on the server also use TaxServiceKey
as a Subject value. You need to ensure that the service identifies itself with a certificate
whose subject name and distinguished names are TaxServiceKey. Which code segment
should you use?

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?