[Free] Get all latest Microsoft 70-515 Actual Tests 181-190

Ensurepass

QUESTION 181

You are implementing a Web page that displays text that was typed by a user. You need to display the user input in the Web page so that a cross-site scripting attack will be prevented. What should you do?

 

A.

Call document.write.

B.

Call Response.Write.

C.

Call HttpUtility.UrlEncode.

D.

Call HttpUtility.HtmlEncode.

 

Correct Answer: D

 

 

QUESTION 182

You create a Web page that contains the following code.

 

clip_image001

 

You need to provide the following implementation.

 

Each time the AddFile button is clicked, a new div element is created.

 

The new div element is appended after the other file upload div elements and before the AddFile span.

 

Each new element has a unique identifier.

 

Which code segment should you use?

 

A.

$(“#AddFile”).click(function () {

var id = “File” + ++lastId;

var item = $(“.File:first”).clone(true);

$(“input:file”, item).attr({ id: id, name: id }); item.insertBefore(“#AddFile”);

});

B.

$(“#AddFile”).click(function () {

var id = “File” + ++lastId;

$(“.File:first”).clone(true).attr({ id: id, name: id }).insertBefore (“#AddFile”);

});

C.

$(“#AddFile”).click(function () {

var id = “File” + ++lastId;

});

D.

$(“#AddFile”).click(function () {

var id = “File” + ++lastId;

var item = $(“.File:first”).clone(true);

$(“input:file”, item).attr({ id: id, name: id }); item.insertAfter(“input[type=file]”);

});

 

Correct Answer: A

Explanation:

clone() Method

(http://api.jquery.com/clone/)

 

 

QUESTION 183

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

 

clip_image002

 

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>

</ul>

D.

<ul id=”color”>

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

E.

<ul id=”color”>

<li><a

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

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

F.

<ul id=”color”>

 

Correct Answer: A

 

 

QUESTION 184

You are implementing an ASP.NET AJAX page. You add the following control to the page.

 

<asp:UpdatePanel ID=”pnl1″ runat=”server” UpdateMode=”Conditional”>

 

<ContentTemplate> … </ContentTemplate>

 

</asp:UpdatePanel>

 

You need update the contents of the UpdatePanel without causing a full reload of the page.

 

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

 

A.

Add the following control before the UpdatePanel. <asp:Timer ID=”Timer1″ OnLoad=”Timer1_Tick” runat=”server” Interval=”3000″ />

B.

Add the following control within the UpdatePanel. <asp:Timer ID=”Timer1″ OnLoad=”Timer1_Tick” runat=”server” Interval=”3000″ />

C.

Add an AsyncPostBackTrigger that references Timer1.

D.

Add a PostBackTrigger that references Timer1.

 

Correct Answer: BC

 

 

QUESTION 185

You are creating an ASP.NET Web application that uses the SqlMembershipProvider. You plan to test locally and deploy to multiple production servers. You need to ensure that each deployed application accesses the same production database in Microsoft SQL Server. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

 

A.

Run the aspnet_regsql command to create the database on the appropriate SQL Server computer.

B.

Right-click App_Data in your Visual Studio 2010 project, click Add, and select New Item to create the SQL Server database on the appropriate SQL Server computer.

C.

Modify the connection string in the web.config file to specify the names of the production server and database.

D.

Modify the web.release.config file to transform the connection string to specify the names of the production server and database.

 

Correct Answer: AD

 

 

QUESTION 186

You create a page in an ASP.NET Web application. The page retrieves and displays data from a Microsoft SQL Server database. You need to create a data source that can connect to the database. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

 

A.

Use an ObjectDataSource control and set its TypeName property to System.Data.SqlClient.SqlConnection.

B.

Use a SqlDataSource control and configure its ConnectionString in the web.config file.

C.

Use an XmlDataSource control together with an Xml control that represents the database.

D.

Use a LinqDataSource control with entity classes that represent the elements in the database.

 

Correct Answer: BD

 

 

 

 

 

QUESTION 187

Gridview: How to change the image of an image control place in each row in a gridview:

 

A.

ItemDataBound

B.

Init

C.

Prerender

D.

<something I don’t remember>

 

Correct Answer: A

 

 

QUESTION 188

You are developing an ASP.NET Web page named WebPage.aspx.

 

The page includes a user control named UserlnfoControl.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;

 

Correct Answer: BD

 

 

QUESTION 189

You are developing an ASP.NET template server control. You need to ensure that a new ID namespace is created within the page control hierarchy when the control. Which interface should you implement on the control?

 

A.

DataItemContainer

B.

NamingContainer

C.

DataKeysControl

D.

ExtenderControl

 

Correct Answer: B

 

 

QUESTION 190

You are developinASP.NETg an 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 ScaffoldAMTables 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 attribute.

C.

Create a partial class for the Order and Customer entities within the Web application and apply the[ScaffoldAMTables ]

D.

Create a partial class for the Order and Customer entities within the Entities library and apply the [ScaffoldAMTables ]

 

Correct Answer: D

 

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

Instant Access to Try Microsoft 70-515 Free Demo

This entry was posted in 70-515 Actual Tests and tagged , , , , , . Bookmark the permalink.