Latest 70-515 Real Exam Download 91-100

Ensurepass

QUESTION 91

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

Answer: A


QUESTION 92

You are implementing an ASP.NET Web site that uses a custom server control named Task. Task is defined as shown in the following list.

Class name: Task Namespace: DevControls

Assembly: TestServerControl.dll

Base class: System.Web.UI.WebControls.WebControl

You copy TestServerControl.dll to the Web site’s Bin folder.

You need to allow the Task control to be declaratively used on site pages that do not contain an explicit @ Register directive.

Which configuration should you add to the web.config file?

A. <appSettings>

<add key="Dev:Task" value="DevControls, DevControls.Task"/>

</appSettings>

B. <compilation targetFramework="4.0" explicit="false">

<assemblies>

<add assembly="TestServerControl" />

</assemblies>

</compilation>

C. <pages>

<controls>

<add assembly="TestServerControl" namespace="DevControls"

tagPrefix="Dev"/>

</controls>

</pages>

D. <pages>

<tagMapping>

<add tagType="System.Web.UI.WebControls.WebControl"

mappedTagType="DevControls.Task"/>

</tagMapping>

</pages>

Answer: C


QUESTION 93

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?

A. VaryByCustom="browser"

B. VaryByCustom="User-Agent"

C. VaryByHeader="browser"

D. VaryByHeader="User-Agent"

Answer: A


QUESTION 94

You are developing an ASP.NET web page named WebPage.aspx. The page includes a user control named UserInfoControl.ascx.

You need to expose a control property named FirstName and read its value from the page.

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

A. Add the following code segment to UserInfoControl.ascx.cs: protected string FirstName { get; set; }

B. Add the following code segment to UserInfoControl.ascx.cs: public string FirstName { get; set; }

C. Add the following code segment to WebPage.aspx.cs: var firstName = UserInfoControl1.Attributes["FirstName"];

D. Add the following code segment to WebPage.aspx.cs: var firstName = UserInfoControl1.FirstName;

Answer: BD


QUESTION 95

You are developing an ASP.NET Web page.

The page contains the following markup.

<asp:GridView ID="gvModels" runat="server" onrowdatabound="gvModels_RowDataBound" AutoGenerateColumns="false">

<Columns>

<asp:BoundField DataField="Name" HeaderText="Model" />

<asp:TemplateField>

<ItemTemplate>

<asp:Image ID="img" runat="server" />

</ItemTemplate>

</asp:TemplateField>

</Columns>

</asp:GridView>

The pages code-behind file includes the following code segment. (Line numbers are included for reference only.)

01 protected void gvModels_RowDataBound(object sender, GridViewRowEventArgs e) 02 {

03 if (e.Row.RowType == DataControlRowType.DataRow) 04 {

05 CarModel cm = (CarModel)e.Row.DataItem; 06

07 img.ImageUrl = String.Format("images/{0}.jpg", cm.ID); 08

9 }

10 }

You need to get a reference to the Image named img. Which code segment should you add at line 06?

A. Image img = (Image)Page.FindControl("img");

B. Image img = (Image)e.Row.FindControl("img");

C. Image img = (Image)gvModels.FindControl("img");

D. Image img = (Image)Page.Form.FindControl("img");

Answer: B


QUESTION 96

You are developing an ASP.NET web page that includes a text box control. The page includes a server-side method named ValidateValue.

You need to configure the page so that the text box value is validated by using the ValidateValue method.

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

A. Use the CompareValidator control.

B. Use the CustomValidator control.

C. Set ValidationGroup on the control to ValidateValue.

D. Set OnServerValidate on the control to ValidateValue.

Answer: BD


QUESTION 97

You are developing an ASP.NET MVC 2 Web application.

A page makes an AJAX request and expects a list of company names in the following format.

["Adventure Works","Contoso"]

You need to write an action method that returns the response in the correct format. Which type should you return from the action method?

A. AjaxHelper

B. XDocument

C. JsonResult

D. DataContractJsonSerializer

Answer: C


QUESTION 98

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

Answer: C


QUESTION 99

You are developing an ASP.NET Web service.

The following code segment implements the service. (Line numbers are included for reference only.)

1 [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

2 public class ProductService : System.Web.Services.WebService

3 {

4 [WebMethod]

5 public Product GetProduct(string name)

6 {

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")]

Answer: AD


QUESTION 100

You are developing an ASP.NET Web application.

Application data is stored in a Microsoft SQL Server 2008 database. You configure a connection string named cnnContoso.

The application must cache the data that is returned from the database by using this connection string. You need to ensure that the application checks the database every 10 seconds.

What should you do?

A. Add the following configuration to the <system.web> section of the web.config file.

<caching>

<outputCacheSettings>

<outputCacheProfiles>

<add name="cnnContoso" duration="10" />

</outputCacheProfiles>

</outputCacheSettings>

</caching>

B. Add the following configuration to the <system.web> section of the web.config file.

<caching>

<sqlCacheDependency enabled="true" pollTime="10000">

<databases>

<add name="ContosoDatabase" connectionStringName="cnnContoso" /

>

</databases>

</sqlCacheDependency>

</caching>

C. Add the following @ Page directive to pages that query the database.

<%@ OutputCache Duration="10" VaryByParam="cnnContoso" %>

D. Add the following @ Page directive to pages that query the database.

<%@ OutputCache Duration="10000" VaryByParam="cnnContoso" %>

Answer: B

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