PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

You need to ensure that the page displays a list of supervisors with their corresponding employees

You are updating an ASP.NET Web Application. The application includes the fallowing classes.
public class Supervisor
{
public string FirstName { get; set; }
public string LastName { get; set; }
public List<Employee> Employees { get; set; }
}
public class Employee
{
public String FirstName { get; set; }
public String LastName { get; set; }
}
An application page contains the fallowing markup.
<asp:Repeater ID=”rptSupervisor” runat=”server”
DataSourceID=”odsEmployees”>
<ItemTemplate>
<%#Eval(“FirstName”) %> <%#Eval(“LastName”) %>

Employees:

<asp:Repeater ID=”rptEmployees” runat=”server”>
<ItemTemplate>
<%#Eval(“FirstName”) %> <%#Eval(“LastName”) %>

</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
<asp:ObjectDataSource ID=”odsEmployees” runat=”server”
SelectMethod=”GetSupervisorWithEmployees”
TypeName=”BusinessLayer”>
</asp:ObjectDataSource>
You need to ensure that the page displays a list of supervisors with their corresponding employees.
What should you do?

Which code segment should you use?

You are developing a client application that consumes a Windows Communication
Foundation (WCF) service. You use the svcutil.exe utility to create a proxy for the service.
You use the svcutil.exe switches that generate asynchronous calls. GetFlight is a service
operation that takes no parameters and returns a string. The GetFlightCallback method
must be called when the service operation returns. You create an instance of the client
proxy with the following code. Dim client As TravelServiceClient = New
TravelServiceClient() You need to ensure that a callback is received when the GetFlight
operation is called asynchronously. Which code segment should you use?

You need to ensure that the custom formatting is applied to only the EmailAddress property

You are developing a Asp.net MVC 2 application The following Customer class is rendered by the
Html.DisplayForModel helper method.
public class Customer
{
public string FirstName { get; set;}
public string LastName { get; set;}
public string EmailAddress { get; set;}

}
You create a partial view named Email.ascx in the Views/Shared/DisplayTemplates folder. Email.ascx
performs custom formatting of e-mail addresses. You need to ensure that the custom formatting is
applied to only the EmailAddress property. What should you do?

Which client endpoint configuration should you use?

You are developing an ASP.NET web application. The application consumes a WCF service that
implements a contract named IcontosoService. The service is located on the local network and is
exposed using the following endpoint <endpoint name=”udpDiscover”
kind=”udpDiscoveryEndpoint”/>
You need to consume the service by using the WS-Discovery protocol. Which client endpoint
configuration should you use?

Which code segment should you use to update the social status?

You are developing an application to update a users social status. You need to consume
the service using Windows Communication Foundation (WCF). The client configuration is
as follows. <system.serviceModel> <bindings> <webHttpBinding> <binding
name=”SocialConfig”> <security mode=”TransportCredentialOnly”> <transport
clientCredentialType=”Basic” realm=”Social API” /> </security> </binding>
</webHttpBinding> </bindings> <client> <endpoint address= ” http:// contoso .com “
binding=”webHttpBinding” bindingConfiguration=”SocialConfig” ontract=”ISocialStatus”

name=”SocialClient” /> </client> </system.serviceModel> The service contract is defined as
follows. <ServiceContract()> Public Interface ISocialStatus <OperationContract()>
<WebInvoke(UriTemplate:=”/statuses/update.xml?status={text}”)> Sub UpdateStatus(ByVal
text As String) End Interface Which code segment should you use to update the social
status?

You need to ensure that the routes are registered correctly

You are developing an ASP.NET MVC 2 Web application that displays product details. The
global.asax.cs file contains the following code segment
01 public static void registerRoutes(RouteCollection routes)
02 {
03 routes.IgnoreRoute(“{resource}.axd/{*pathInfo}”);
04 routes.MapRoute(“Default”, “{controller}/{action}/{id}”, new {controller = “Home”, action =
“index”, id =
UrlParameter.Optional});
05 }
The URL “/products/PRODUCTNAME”, where PRODUCTNAME is the name of the product, must give
details for the product that is stored in a Microsoft SQL Server database. You need to ensure that the
routes are registered correctly. What should you do?

You need to acces the EmployeeName value and display the value within the lblEmployeeName label

You are developing an ASP.Net web application. The application includes a master page named
CustomerMaster.master that contains a public string property name EmployeeName application also
includes a second master page named NestedMaster.master that is defined by the following
directive.
<%@ Master Language=”C#”
MasterPageFile=”~/CustomMaster.Master”
CodeBehind=”NestedMaster.Master.cs”
Inherits=”MyApp.NestedMaster”%>
You add a content page that uses the NestedMaster.master page file.The content page contains a
label control named lblEmployeeName. You need to acces the EmployeeName value and display the
value within the lblEmployeeName label. What should you do?