Home » [Free] Get all latest Microsoft 70-515 Actual Tests 81-90

[Free] Get all latest Microsoft 70-515 Actual Tests 81-90

Ensurepass

QUESTION 81

You create an ASP.NET page named TestPage.aspx that contains validation controls. You need to verify that all input values submitted by the user have been validated by testing the Page.IsValid property. Which page event should you add an event handler to?

 

A.

Init

B.

Load

C.

PreInit

D.

PreLoad

 

Correct Answer: B

 

 

QUESTION 82

You are implementing an ASP.NET application that includes a page named TestPage.aspx. TestPage.aspx uses a master page named TestMaster.master.

 

You add the following code to the TestPage.aspx code-behind file to read a TestMaster.master public property named CityName.

 

protected void Page_Load(object sender, EventArgs e)

 

{

 

string s = Master.CityName;

 

}

 

You need to ensure that TestPage.aspx can access the CityName property.

 

What should you do?

 

A.

Add the following directive to TestPage.aspx. <%@ MasterType VirtualPath=”~/TestMaster.master” %>

B.

Add the following directive to TestPage.aspx. <%@ PreviousPageType VirtualPath=”~/TestMaster.master” %>

C.

Set the Strict attribute in the @ Master directive of the TestMaster.master page to true.

D.

Set the Explicit attribute in the @ Master directive of the TestMaster.master page to true.

 

Correct Answer: A

 

 

QUESTION 83

You are implementing an ASP.NET Web site that will be accessed by an international audience. The site contains global and local resources for display elements that must be translated into the language that is selected by the user. You need to ensure that the Label control named lblCompany displays text in the users selected language from the global resource file. Which control markup should you use?

 

A.

<asp:Label ID=”lblCompany” runat=”server” meta:resourcekey=”lblCompany” />

B.

<asp:Label ID=”lblCompany” runat=”server” Text=”meta:lblCompany.Text” />

C.

C.<asp:Label ID=”lblCompany” runat=”server” Text=”<%$ Resources:lblCompanyText %>” />

D.

D.<asp:Label ID=”lblCompany” runat=”server” Text=”<%$ Resources:WebResources, lblCompanyText %>” />

 

Correct Answer: D

 

 

QUESTION 84

You are developing an ASP.NET Web application. You create a master page. The master page requires a region where you can add page-specific content by using the ASP.NET page designer. You need to add a control to the master page to define the region. Which control should you add?

 

A.

Content

B.

ContentPlaceHolder

C.

PlaceHolder

D.

Substitution

 

Correct Answer: B

 

 

QUESTION 85

You are implementing an ASP.NET application that uses data-bound GridView controls in multiple pages. You add JavaScript code to periodically update specific types of data items in these GridView controls. You need to ensure that the JavaScript code can locate the HTML elements created for each row in these GridView controls, without needing to be changed if the controls are moved from one page to another. What should you do?

 

A.

Replace the GridView control with a ListView control.

B.

Set the ClientIDMode attribute to Predictable in the web.config file.

C.

Set the ClientIDRowSuffix attribute of each unique GridView control to a different value.

D.

Set the @ OutputCache directives VaryByControl attribute to the ID of the GridView control.

 

Correct Answer: C

 

 

QUESTION 86

You have created an ASP.NET server control named ShoppingCart for use by other developers. Some developers report that the ShoppingCart control does not function properly with ViewState disabled. You want to ensure that all instances of the ShoppingCart control work even if ViewState is disabled. What should you do?

 

A.

Require developers to set EnableViewStateMac to true.

B.

Store state in ControlState instead of ViewState.

C.

Serialize the state into an Application state entry called “MyControl”.

D.

Require developers to change the session state mode to SQLServer.

 

Correct Answer: B

 

 

QUESTION 87

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” %>

 

Correct Answer: B

 

 

QUESTION 88

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

 

08 protected void btnSubmit_Click(object sender,

 

EventArgs e)

 

09 {

 

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();

 

Correct Answer: D

Explanation:

 

 

QUESTION 89

You are creating an ASP.NET Web site. The site has a master page named Custom.master. The code-behind file for Custom.master contains the following code segment.

 

public partial class CustomMaster : MasterPage

 

{

 

public string Region

 

{

 

get; set;

 

}

 

protected void Page_Load(object sender, EventArgs e)

 

{

 

}

 

}

 

You create a new ASP.NET page and specify Custom.master as its master page.

 

You add a Label control named lblRegion to the new page.

 

You need to display the value of the master page’s Region property in lblRegion.

 

What should you do?

 

A.

Add the following code segment to the Page_Load method of the page code-behind file.

CustomMaster custom = this.Parent as CustomMaster;

lblRegion.Text = custom.Region;

B.

Add the following code segment to the Page_Load method of the page code-behind file.

CustomMaster custom = this.Master as CustomMaster;

lblRegion.Text = custom.Region;

C.

Add the following code segment to the Page_Load method of the Custom.Master.cs code-behind file.

Label lblRegion = Page.FindControl(“lblRegion”) as Label;

lblRegion.Text = this.Region;

D.

Add the following code segment to the Page_Load method of the Custom.Master.cs code-behind file.

Label lblRegion = Master.FindControl(“lblRegion”) as Label;

lblRegion.Text = this.Region;

 

Correct Answer: B

 

 

QUESTION 90

You create a Web page that contains the following code. (Line numbers are included for reference only.)

 

01 <script>

 

02 function changeColor(c) {

 

03 document.getElementById(“message”).style.color=c;

 

04 }

 

05 </script>

 

06

 

07 <p id=”message”>Welcome!</p>

 

08 <ul id=”color”>

 

09 <li>Black</li>

 

10 <li>Red</li>

 

11 </ul>

 

You need to ensure that when the user clicks an item in the list, the text color of the Welcome! message will change. Which declaration should you use?

 

A.

<ul id=”color”>

<li onclick=”changeColor(this.innerText);”>Black</li> <li onclick=”changeColor(this.innerText);”>Red</li> </ul>

B.

<ul id=”color”>

<li onclick=”changeColor(this.style.color);”>Black</li> <li onclick=”changeColor(this.style.color);”>Red</li> </ul>

C.

<ul id=”color”>

<li><a onfocus=”changeColor(this.innerText);”>Red</a></li> <li><a onfocus=”changeColor(this.innerText);”>Black</a></li> </ul>

D.

<ul id=”color”>

<li><a onfocus=”changeColor(this.style.color);”>Red</a></li> <li><a onfocus=”changeColor(this.style.color);”>Black</a></li> </ul>

 

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