PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

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.
public ActionResult Edit(int id)
{
return View(SelectUserToEdit(id));
}
public ActionResult Edit(Person person)
{
UpdateUser(person);
return RedirectToAction(“Index”);
}
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.)

What are two possible properties you can use to achieve this goal?

Self-hosted Windows Communication Foundation (WCF) service uses a secure HTTP

binding with a custom principal permission mode. The binding requires users to provide
their Windows logon credentials. You need to retrieve the identity of the caller. What are two
possible properties you can use 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 : Controller
{
static List<Product> products = new List<Product>();
public ActionResult Index()
{
return View();
}}
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?

You need to ensure that users can access the WCF services without having to re-authenticate

You are creating an ASP.NET Web application that hosts several Windows Communication
Foundation (WCF) services. The services have ASP.NET Compatibility Mode enabled.
Users authenticate with the Web application by using a cookie-based ASP.NET Forms
Authentication model. You add a service file named Authentication.svc that contains the
following code segment. <%@ ServiceHost
Service=”System.Web.ApplicationServices.AuthenticationService”
Factory=”System.Web.ApplicationServices.ApplicationServicesHostFactory” %> You need
to ensure that users can access the WCF services without having to re-authenticate. Which
two configuration settings should you add (Each is part of a complete solution. Choose two.)

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 caching 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 implement the service to meet these requirements

You are creating a windows Communication Foundation (WCF) service to process orders.
The data contract for the order is defined as follows: [DataContract] public class Order { …
[DataMemberl public string CardHolderName { get; set; [DataMember] public string
CreditCardNumber { get; set; } } You have the following requirements – – – Enable the
transmission of the contents of Order from the clients to the service. Ensure that the
contents of CreditCardNumber are not sent across the network in clear text. Ensure that the
contents of CreditCardNumber are accessible by the service to process the order. You need
to implement the service to meet these requirements. What should you do?

Which code segment should you use?

You are implementing an ASP.NET Web site. The site allows users to explicitly choose the display
language for the site’s Web pages. You create a Web page that contains a DropDownList named
ddlLanguage, as shown in the following code segment.
<asp:DropDownList ID=”ddlLanguage” runat=”server” AutoPostBack=”True”
ClientIDMode=”Static”OnSelectedIndexChanged=”SelectedLanguageChanged”>
<asp:ListItem Value=”en”>English</asp:ListItem>
<asp:ListItem Value=”es”>Spanish</asp:ListItem>
<asp:ListItem Value=”fr”>French</asp:ListItem>
<asp:ListItem Value=”de”>German</asp:ListItem>
</asp:DropDownList>
The site contains localized resources for all page content that must be translated into the language
that is selected by the user. You need to add code to ensure that the page displays content in the
selected language if the user selects a language in the drop-down list. Which code segment should
you use?