[Free] Get all latest Microsoft 70-515 Actual Tests 91-100

Ensurepass

QUESTION 91

You create a Web page that contains drop-down menus that are defined by using div tags in the following code.

 

clip_image001

 

You need to write a JavaScript function that will enable the drop-down menus to activate when the user positions the mouse over the menu title.

 

Which code segment should you use?

 

A.

$(“.dropdown-menu”).hover(

function () {

$(“.menu-items”). slideDown (100);

},

function () {

$(“.menu-items”). slideUp (100);

}

);

B.

$(“.dropdown-menu”).hover(

function () {

$(“.menu-items”, this). slideDown (100);

},

function () {

$(“.menu-items”, this). slideUp (100);

}

);

C.

$(“.dropdown-menu”).hover(

function () {

$(this). slideDown (100);

},

function () {

$(this). slideUp (100);

}

);

D.

$(“.dropdown-menu”).hover(

function () {

$(this, “.menu-title”). slideDown (100);

},

function () {

$(this, “.menu-title”). slideUp (100);

}

);

 

Correct Answer: B

Explanation:

hover() function

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

 

 

QUESTION 92

You create a Web page that contains the following div.

 

<div id=”target”>

 

</div>

 

You have a JavaScript array named imageurls that contains a list of image URLs.

 

You need to write a JavaScript function that will insert images from the URLs into target.

 

Which code segment should you use?

 

A.

$( imageurls ).each(function( i,url ){

$(“< img />”, url ).append(“#target”);

});

B.

$( imageurls ).each(function( i,url ){

$(“#target”) += $(“< img />”). attr (” src “, url ); });

C.

$.each( imageurls , function( i,url ){

$(“< img />”). attr (” src “, url ). appendTo (“#target”); });

D.

$.each( imageurls , function( i,url ){

$(“#target”).append(“< img />”). src = url ;

});

 

Correct Answer: C

Explanation:

appendTo() Method

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

jQuery.each() Function

(http://api.jquery.com/jQuery.each/)

 

 

QUESTION 93

You are developing an ASP.NET Web page. You add a data-bound GridView control. The GridView contains a TemplateField that includes a DropDownList. You set the GridViews ClientIDMode property to Static, and you set the ClientIDRowSuffix property to ProductID. You need to be able to reference individual DropDownList controls from client-side script by using the ProductID. What should you set the ClientIDMode property of the DropDownList to?

 

A.

AutoID

B.

Static

C.

Inherit

D.

Predictable

 

Correct Answer: D

 

 

 

 

QUESTION 94

You are implementing an ASP.NET AJAX page that contains two div elements. You need to ensure that the content of each div element can be refreshed individually, without requiring a page refresh. What should you do?

 

A.

Add two forms to the page.

Add a script manager and an update panel to each form. Add a content template to each update panel, and move each div element into a content template.

B.

Add two forms to the page.

Add a script manager and an update panel to each form. Add a content template to each update panel, and move each div element into a content template.

C.

Add a form and two update panels to the page.

Add a script manager to the form.

Add a content template to each update panel, and move a div element into each content template.

D.

Add a form and two update panels to the page. Add two script managers to the form, one for each update panel. Add a content template to each update panel, and move each div element into a content template.

 

Correct Answer: C

 

 

QUESTION 95

You create a Web page that contains the following image element.

 

<img id=”myImage” src=”/image1.png” />

 

You need to write a JavaScript function that will dynamically change which image is displayed. The function must be compatible across different browsers. Which code segment should you use?

 

A.

function changeImage() {

myImage.src = “image2.png”;

}

B.

function changeImage() {

document.getElementById(“myImage”).src =

“image2.png”;

}

C.

function changeImage() {

getElementById(“myImage”).src =

“image2.png”;

}

D.

function changeImage() {

window.getElementById(“myImage”).src =

“image2.png”;

}

 

Correct Answer: B

 

 

QUESTION 96

A Web service returns a list of system users in the following format.

 

<?xml version=”1.0″ ?>

 

<users>

 

<user id=”first”>

 

<name>Name of first user</name>

 

<email>first@contoso.com</email>

 

</user>

 

<user id=”second”>

 

<name>Name of second user</name>

 

<email>second @contoso.com</email>

 

</user>

 

</users>

 

You need to populate a drop-down menu with the IDs and names of the users from the Web service, in the order provided by the service.

 

Which code segment should you use?

 

A.

$.ajax({

type: “GET”,

url: serviceURL,

success: function(xml) {

$.each($(xml), function(i, item) {

$(“<option>”).attr(“value”, id)

.text(tx).appendTo(“#dropdown”);

});

}

});

B.

$.ajax({

type: “GET”,

url: serviceURL,

success: function(xml) {

$(xml).find(“user”).each(function() {

var id = $(this).id;

var tx = $(this).name.text;

$(“<option>”).attr(“value”, id)

.text(tx).appendTo(“#dropdown”);

});

}

});

C.

$.ajax({

type: “GET”,

url: serviceURL,

success: function(xml) {

$(xml).find(“user”).each(function() {

var id = $(this).attr(“id”);

var tx = $(this).find(“name”).text();

$(“<option>”).attr(“value”, id)

.text(tx).appendTo(“#dropdown”);

});

}

});

D.

$.ajax({

type: “GET”,

url: serviceURL,

success: function(xml) {

xml.find(“user”).each(function(node) {

var id = $(node).attr(“id”);

var tx = $(node).find(“name”).text();

$(“<option>”).attr(“value”, id)

.text(tx).appendTo(“#dropdown”);

});

}

});

 

Correct Answer: C

Explanation:

each() function

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

CHAPTER 9 Working with Client-Side Scripting, AJAX, and jQuery Lesson 3: Implementing jQuery

Implementing AJAX with jQuery

 

 

QUESTION 97

You are implementing an ASP.NET AJAX page. You add two UpdatePanel controls named pnlA and pnlB. pnlA contains an UpdatePanel control named pnlAInner in its content template. You have the following requirements. You need to configure the panels to meet the requirements. What should you do?

 

A.

Set the UpdateMode of pnlA and pnlB to Conditional. Set the UpdateMode of pnlAInner to Always.

B.

Set the UpdateMode of pnlA and pnlB to Conditional. Set the UpdateMode of pnlAInner to Conditional, and add AsyncPostBackTrigger elements to its Triggers element for every control in pnlA.

C.

Set the UpdateMode of pnlA and pnlB to Always. Set the UpdateMode of pnlAInner to Conditional.

D.

Set the UpdateMode of pnlA and pnlB to Always. Set the UpdateMode of pnlAInner to Always, and add AsyncPostBackTrigger elements to its Triggers element for every control in pnlB.

 

Correct Answer: A

 

 

QUESTION 98

You are implementing an ASP.NET Web page.

 

You need to add a text box that allows only values between 1 and 10, inclusive, to be submitted.

 

Which two code segments should you use? (Each correct answer presents part of the solution. Choose two.)

 

A.

<script type=”text/javascript”>

function validate_value(obj, args) {

return

(args.Value >= 1 && args.Value <= 10);

}

</script>

B.

<script type=”text/javascript”>

function validate_value(obj, args) {

args.IsValid =

(args.Value >= 1 && args.Value <= 10);

}

</script>

C.

<asp:TextBox ID=”txt1″ runat=”server” />

<asp:CustomValidator ID=”val1″ runat=”server”

ControlToValidate=”txt1″

ClientValidationFunction=”validate_value”

ErrorMessage=”Value invalid” />

D.

<asp:TextBox ID=”txt1″ runat=”server” onChange=”validate_value(this, args)” />

 

Correct Answer: BC

Explanation:

CHAPTER 5 Input Validation and Site Navigation

Lesson 1: Performing Input Validation

The CustomValidator Control

 

 

QUESTION 99

You are implementing an ASP.NET page that includes a text box.

 

You need to validate values that are typed by users to ensure that only numeric values are submitted.

 

Which control markup should you use?

 

A.

<asp:TextBox ID=”txt1″ runat=”server”

CausesValidation=”true”

ValidationGroup=”Numeric” />

B.

<asp:TextBox ID=”txt1″ runat=”server”

EnableClientScript=”true”

ValidationGroup=”Numeric” />

C.

<asp:TextBox ID=”txt1″ runat=”server” />

<asp:RegularExpressionValidator ID=”val1″

runat=”server”

ControlToValidate=”txt1″

ValidationExpression=”[0-9]*”

ErrorMessage=”Invalid input value” />

D.

<asp:TextBox ID=”txt1″ runat=”server” />

<asp:RegularExpressionValidator ID=”val1″

EnableClientScript=”true” ControlToValidate=”txt1″ ValidationExpression=”[0-9]*”

ErrorMessage=”Invalid input value” />

 

Correct Answer: C

Explanation:

JavaScript executes as users enter and leave the focus of the controls on your page. Client-side validation is turned on by default. You can turn it off for specific validation controls by setting the EnableClientScript property to false.

CHAPTER 5 Input Validation and Site Navigation

Lesson 1: Performing Input Validation

Client-Side Validation (page 231)

 

QUESTION 100

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

 

09 }

 

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

 

Correct Answer: B

 

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.