Latest 70-515 Real Exam Download 101-110

Ensurepass

QUESTION 101

You are developing an ASP.NET Web page that contains input controls, validation controls, and a button named btnSubmit.

The page has the following code-behind. (Line numbers are included for reference only.)

01 public partial class _Default : System.Web.UI.Page 02 {

03 protected void SaveToDatabase() 04 {

05

06 }

07

8 protected void btnSubmit_Click(object sender, EventArgs e)

9 {

10

11 }

12 }

You need to ensure that all data that is submitted passes validation before the data is saved in a database. What should you do?

A. Add the following method override.

protected override void OnInit(EventArgs e)

{

base.OnInit(e);

if (Page.IsValid) this.SaveToDatabase();

}

B. Add the following method override.

protected override void OnLoad(EventArgs e)

{

base.OnLoad(e);

if (Page.IsValid) this.SaveToDatabase();

}

C. Add the following method override.

protected override void OnPreRender(EventArgs e)

{

base.OnPreRender(e);

if (Page.IsValid) this.SaveToDatabase();

}

D. Add the following code segment at line 10.

if (Page.IsValid) this.SaveToDatabase();

Answer: D


QUESTION 102

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?

A. Rename Email.ascx to String.ascx.

B. Add the following attribute to the EmailAddress property. [DataType(DataType.EmailAddress)]

C. Add the following attribute tot the EmailAddress property [UIHint("Email")]

D. Rename Email.ascx to EmailAddress.ascx Answer: C


QUESTION 103

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?

A. <endpoint name=”contosoEndpoint” address=”oneway-basic” binding=”basicHttpBinding” contract=”IContosoService”/>

B. <endpoint name=”contosoEndpoint” kind=”dynamicEndpoint” binding=”wsHttpBinding” contract=”IContosoService”/>

C. <endpoint name=”contosoEndpoint” address=”twoway-basic” binding=”basicHttpBinding” contract=”IContosoService”/>

D. <endpoint name=”contosoEndpoing” address=”dynamicEndpoint” binding=”wsHttpBinding” contract=”*”/>

Answer: B


QUESTION 104

You are developing an ASP.NET web page.

You need to ensure that content flows from right to left.

What should you do?

A. In the @Page directive, add an attribute named dir with a value of “RightToLeft”

B. In the @Page directive, add an attribute named dir with a value of “RTL”

C. In the <html> tag, add an attribute named dir with a value of “RTL”

D. In the <html> tag, add an attribute named dir with a value of “RightToLeft”

Answer: C


QUESTION 105

You are implementing an ASP.NET web page that contains a ScriptManager control.

You need to ensure that only the required Microsoft AJAX Framework Javascript files are loaded.

A. Set the AjaxFrameworkMode property of the ScriptManager to Enabled, and reference each javascript file by adding a ScriptReference for each required file.

B. Set the AjaxFrameworkMode property of the ScriptManager to Explicit, and reference each JavaScript file by adding a ScriptReference for each required file.

C. Set the AjaxFrameworkMode property of the ScriptManager to Disabled, and reference each JavaScript file by adding a ScriptReference for each required file.

D. Set the AjaxFrameworkMode property of the ScriptManager to Enabled, and manually add a reference to each required JavaScript file to the HTML page head element.

Answer: B


QUESTION 106

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 {

3 routes.IgnoreRoute(“{resource}.axd/{*pathInfo}”);

4 routes.MapRoute(“Default”, “{controller}/{action}/{id}”, new {controller = “Home”, action = “index”, id = UrlParameter.Optional});

5 }

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?

A. Replace line 04 with the following code segment

routes.MapRoute(“products/{productName}, “ProductDetails”, new {controller = “Products”, action = “index”, productName = UrlParameter.Optional});

B. Add the following code segment between lines 04 and 05 routes.MapRoute(“ProductDetails, “products/{productName}”, new {controller = “Products”, actions=”index”, productName = UrlParameter.Optional});

C. Replace lines 03 and 04 with the following code segment routes.MapRoute(“products/{productName}”, “ProductDetails”, new {controller =”Products”,

action=”Index”, productName=UrlParameter.Optional});

D. Add the following code segment between lines 03 and 04. routes.MapRoute(“ProductDetails”,”products/{productName}”, new {controller=”products”, action

=”Index”, productName = UrlParameter.Optional});

Answer: D


QUESTION 107

You are deloping an ASP.NET Dynamic Data Web application. The application uses entities from a global library named Entities.

The Application_Start event contains the following code segment:

DefaultModel.RegisterContect(typeof)( Entities.MyDBDataContext), new ContextConfiguration() { ScaffoldAllTables = false });

You need to ensure that the application shows the Order and Customer entities and hides all other entities.

What should you do?

A. Set the ScaffoldAllTables property of the ContextConfiguration to true.

B. Create a partial class for each entity except Order and Customer within the Entities library and apply the [ScaffoldTable(false)] attribute.

C. Create a partial class for the Order and Customer entities within the web application and apply the [ScaffoldTable(true)] attribute.

D. Create a partial class for the Order and Customer entities within the Entities library and apply the [ScaffoldTable(true)] attribute.

Answer: D


QUESTION 108

You are developing an ASP.NET web page.

The page includes the following EntityDataSource control:

<asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=AdventureWorksEntities" DefaultContainerName="AdventureWorksEntities" EnableFlattening="False" EntitySetName="Products" />

The page must filter the data that is displayed in a grid on a query string parameter named ProductPrefix. The grid must display products whose ProductName starts with the query string value.

You need to ensure that the page generates the appropriate database query. What should you do?

A. Add the following element to the EntityDataSource control:

<WhereParameters>

<asp:DynamicQueryStringParameter QueryStringField="ProductPrefix" Name="ProductName" />

</WhereParameters>

B. Add the following element to the EntityDataSource control:

<WhereParameters>

<asp:QueryStringParameter QueryStringField="ProductPrefix" Name="ProductName" />

</WhereParameters>

C. Add the following element to the EntityDataSource control:

<asp:QueryExtender ID="QueryExtender1" runat="server" TargetControlID="EntityDataSource1">

<asp:PropertyExpression Name="ProductName" />

<asp:DynamicFilterExpression ControlID="ProductPrefix" />

</asp:QueryExtender>

D. Add the following element to the EntityDataSource control:

<asp:QueryExtender ID="QueryExtender1" runat="server" TargetControlID="EntityDataSource1">

<asp:SearchExpression SearchType="StartsWith" DataFields="ProductName">

<asp:QueryStringParameter QueryStringField="ProductPrefix" />

</asp:SearchExpression>

</asp:QueryExtender>

Answer: D


QUESTION 109

You are developing an ASP.NET web application.

The application includes the following Entity Data Model (EDM):

clip_image001

You instantiate an ObjectContext for the EDM named context.

You need to find the total number of addresses that are associated with customers that have a non-null middle name.

Which LINQ to Entities query should you use?

A. var query = context.Customers

.Where(c => c.MiddleName != null)

.Select(c => c.CustomerAddresses.Count();

B. var query = context.Customers

.Where(c => c.MiddleName != null)

.SelectMany(c => c.CustomerAddresses.Count();

C. var query = context.Addresses

.SelectMany(a => a.CustomerAddresses.OfType<Customer>()

.Where(c => c.MiddleName != null)).Count();

D. var query = context.Addresses

.GroupBy(a => a.CustomerAddresses

.Where(ca => ca.Customer.MiddleName != null)).Count();

Answer: B


QUESTION 110

You are developing an ASP.NET web application that you will deploy to an Internet Information Services (IIS) 7.0 server.

The application will run in Integrated pipeline mode. The application contains a phot gallery of images that are stored in a Microsoft SQL Server database.

You need to ensure that the application can retrieve images from the database without blocking IIS worker process threads.

What should you do?

A. Create a synchronous HttpHandler that is registered in the <httpHandlers> section in the web.config file.

B. Create an asynchronous HttpHandler that is registered in the <handlers> section under system. webServer in the web.config file.

C. Create a custom HttpModule that is registered in the <httpModules> section in the web.config file.

D. Create an asynchronous HttpHandler that is registered in the <httpHandlers> section in the web.config file.

Answer: B


Download Latest 70-515 Real Free Tests , help you to pass exam 100%.