Home » [Free] Get all latest Microsoft 70-515 Actual Tests 121-130

[Free] Get all latest Microsoft 70-515 Actual Tests 121-130

Ensurepass

QUESTION 121

You deploy an ASP.NET application to an IIS server. You need to log health-monitoring events with severity level of error to the Windows application event log. What should you do?

 

A.

Run the aspnet_regiis.exe command.

B.

Set the Treat warnings as errors option to All in the project properties and recompile.

C.

Add the following rule to the healthMonitoring section of the web.config file.

<rules>

<add name=”Failures” eventName=”Failure Audits”

provider=”EventLogProvider” />

</rules>

D.

Add the following rule to the healthMonitoring section of the web.config file.

<rules>

<add name=”Errors” eventName=”All Errors” provider=”EventLogProvider” /> </rules>

 

Correct Answer: D

 

 

 

QUESTION 122

You are developing an ASP.NET Dynamic Data Web application.

 

Boolean fields must display as Yes or No instead of as a check box. You replace the markup in the default Boolean field template with the following markup.

 

<asp:Label runat=”server” ID=”label” />

 

You need to implement the code that displays Yes or No.

 

Which method of the FieldTemplateUserControl class should you override in the BooleanField class?

 

A.

OnLoad

B.

Construct

C.

OnDataBinding

D.

SaveControlState

 

Correct Answer: C

 

 

QUESTION 123

You are implementing an ASP.NET page. You add and configure the following ObjectDataSource.

 

clip_image001

 

The page will be called with a query string field named pid.

 

You need to configure the ObjectDataSource control to pass the value of the pid field to GetProductsByProductId method.

 

What should you do?

 

A.

Replace the asp:Parameter with the following declaration.

<asp:QueryStringParameter DefaultValue=”pid” Name=”productId” Type=”Int32″ />

B.

Replace the asp:Parameter with the following declaration.

<asp:QueryStringParameter QueryStringField=”pid” Name=”productId” Type=”Int32″ />

C.

Add the following event handler to the Selecting event of the ObjectDataSource control.

protected void odc_Selecting(object sender,

ObjectDataSourceSelectingEventArgs e)

{

D.

InputParameters[“p id “] = Request.QueryString[“p roductId “]; }

E.

Add the following code segment to the pages code-behind.

protected void Page_Load(object sender, EventArgs e)

{

odc.SelectParameters.Add(“productId”, Request.QueryString[“p i d”]);

}

 

Correct Answer: B

 

 

QUESTION 124

You are implementing an ASP.NET page. Client-side script requires datA.

 

Your application includes a class named Person with a Name property of type string.

 

The code-behind file of the page includes the following code segment.

 

public string JsonValue;

 

List<Person> people = GetPeopleList();

 

JavaScriptSerializer json = new JavaScriptSerializer();

 

You need to use the JavaScriptSerializer class to serialize only the Name property of each item in the people list.

 

Which code segment should you use?

 

A.

JsonValue = json.Serialize(people.Select(p => p.Name));

B.

var names = from person in people

select person;

JsonValue = “{” + json.Serialize(names) + “}”;

C.

JsonValue = json.Serialize(people.SelectMany( p => p.Name.AsEnumerable()));

D.

var names = from person in people

select person;

JsonValue = json.Serialize(names);

 

Correct Answer: A

 

 

QUESTION 125

You are developing an ASP.NET Web page that will display the median value from a sequence of integer values. You need to create an extension method to compute the median value. Which interface should you add the extension method to?

 

A.

IComparer<T>

B.

IEnumerable<T>

C.

IEnumerator<T>

D.

IEqualityComparer<T>

 

Correct Answer: B

 

 

QUESTION 126

You are implementing an ASP.NET Dynamic Data Web site. The Web site includes a data context that enables automatic scaffolding for all tables in the data model.

 

The Global.asax.cs file contains the following code segment.

 

public static void RegisterRoutes(RouteCollection routes) {

 

{

 

routes.Add(new DynamicDataRoute(“{table}/ListDetails.aspx”)

 

{

 

Action = PageAction.List,

 

ViewName = “ListDetails”,

 

Model = DefaultModel

 

});

 

routes.Add(new DynamicDataRoute(“{table}/ListDetails.aspx”)

 

{

 

Action = PageAction.Details,

 

ViewName = “ListDetails”,

 

Model = DefaultModel

 

});

 

}

 

You need to display the items in a table named Products by using a custom layout. What should you do?

 

A.

Add a new Web page named Products.aspx to the Dynamic DataPageTemplates folder of the Web site.

B.

Add a new folder named Products to the Dynamic DataCustomPages folder of the Web site. Add a new Web page named ListDetails.aspx to the Products folder.

C.

Add a new Web user control named Products.ascx to the Dynamic DataFilters folder of the Web site. In the code-behind file for the control, change the base class from UserControl to System.Web.DynamicData.QueryableFilterUserControl.

D.

Add a new Web user control named Products_ListDetails.ascx to the Dynamic DataEntityTemplates folder of the Web site. In the code-behind file for the control, change the base class from UserControl to System.Web.DynamicData.EntityTemplateUserControl.

 

Correct Answer: B

 

 

QUESTION 127

You are implementing a WCF service library. You add a new code file that contains the following code segment.

 

clip_image002

 

You build the service library and deploy its assembly to an IIS application.

 

You need to ensure that the GetCurrentRate method can be called from JavaScript.

 

What should you do?

 

A.

Add a file named Service.svc to the IIS application.

Add the following code segment to the file.

<%@ ServiceHost Service=”ContosoWCF.IRateService”

Factory=”System.ServiceModel.Activation.WebScriptServiceHostFactory”

%>

B.

Add a file named Service.svc to the IIS application.

Add the following code segment to the file.

<%@ ServiceHost Service=”ContosoWCF.RateService”

Factory=”System.ServiceModel.Activation.WebScriptServiceHostFactory”

%>

C.

Apply the ScriptService attribute to the RateService class. Rebuild the WCF service library, and redeploy the assembly to the IIS application.

D.

Apply the WebGet attribute to the GetCurrentRate interface method. Rebuild the WCF service library, and redeploy the assembly to the IIS application.

 

Correct Answer: B

 

 

QUESTION 128

You are implementing an ASP.NET page. The page includes a method named GetCustomerOrderDataSet that returns a DataSet. The DataSet includes a DataTable named CustomerDetailsTable and a DataTable named OrderDetailsTable. You need to display the data in OrderDetailsTable in a DetailsView control named dtlView. Which code segment should you use?

 

A.

dtlView.DataSource = GetCustomerOrderDataSet();

dtlView.DataMember = “OrderDetailsTable”;

dtlView.DataBind();

B.

dtlView.DataSource = GetCustomerOrderDataSet();

dtlView.DataSourceID = “OrderDetailsTable”;

dtlView.DataBind();

C.

dtlView.DataSource = GetCustomerOrderDataSet();

dtlView.DataKeyNames = new string [] { “OrderDetailsTable”};

dtlView.DataBind();

D.

DataSet dataSet = GetCustomerOrderDataSet();

dtlView.DataSource = new DataTable(“dataSet”, “OrderDetailsTable”); dtlView.DataBind();

 

Correct Answer: A

 

 

QUESTION 129

You are developing an ASP.NET Web service. The following code segment implements the service. (Line numbers are included for reference only.)

 

01 [WebServiceBinding(ConformsTo =

 

WsiProfiles.BasicProfile1_1)]

 

02 public class ProductService :

 

System.Web.Services.WebService

 

03 {

 

04 [WebMethod]

 

05 public Product GetProduct(string name)

 

06 {

 

07

 

08 }

 

09

 

10 [WebMethod]

 

11 public Product GetProduct(int id)

 

12 {

 

13

 

14 }

 

15 }

 

You need to ensure that both GetProduct methods can be called from a Web client.

 

Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

 

A.

Remove line 01.

B.

Add the static modifier on lines 05 and 11.

C.

Add the following attribute before line 10.

[SoapDocumentMethod(Action=”GetProductById”)]

D.

Modify the attribute on line 10 as follows.

[WebMethod(MessageName=”GetProductById”)]

 

Correct Answer: AD

Explanation:

WebServiceBindingAttribute Class

(http://msdn.microsoft.com/en-

us/library/system.web.services.webservicebindingattribute.aspx)

 

 

QUESTION 130

You are developing an ASP.NET Web page. The page includes a List<Product> instance. You add a FormView control to display a single Product from this list. You need to bind the list to the FormView control. Which FormView property should you set in the code-behind file?

 

A.

DataSource

B.

DataSourceID

C.

DataKeyNames

D.

DataMember

 

Correct Answer: A

 

Instant Access to Download Testing Software & PDF File for Microsoft 70-515 Real Exam

Instant Access to Try Microsoft 70-515 Free Demo

HOT EXAM!

Name of author

Name: admin