Home » [Free] Get all latest Microsoft 70-515 Actual Tests 141-150

[Free] Get all latest Microsoft 70-515 Actual Tests 141-150

Ensurepass

QUESTION 141

A Web page includes the HTML shown in the following code segment.

 

<span id=”ref”>

 

<a name=Reference>Check out</a>

 

the FAQ on

 

<a href=”http://www.contoso.com”>

 

Contoso</a>’s web site for more information:

 

<a href=”http://www.contoso.com/faq”> FAQ </a>.

 

</span>

 

<a href=”http://www.contoso.com/ home “> Home </a>

 

You need to write a JavaScript function that will dynamically format in boldface all of the hyperlinks in the ref span.

 

Which code segment should you use?

 

A.

$(“#ref”).filter(“a[href]”).bold();

B.

$(“ref”).filter(“a”).css(“bold”);

C.

$(“a”).css({fontWeight:”bold”});

D.

$(“#ref a[href]”).css({fontWeight:”bold”});

 

Correct Answer: D

Explanation:

css() Method

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

 

 

QUESTION 142

You are building an ASP.NET control. The control displays data by using a table element with a class attribute value of Results.

 

The control should expose a client-side event named onrowselected that fires when a check box in a table row is selected.

 

You need to implement this client-side event.

 

What should you do?

 

A.

$(‘.Results input:checked’).onrowselected = function (e, sender) { …

};

B.

$(‘.Results input:checked’).bind(‘onrowselected’, function (e, sender) { …

});

C.

$(‘.Results’).bind(‘onrowselected’, function (e, sender) { …

}).click(function (e) {

if ($(e.target).is(‘input:checked’)) {

$(‘.Results’).trigger(‘onrowselected’, [$(e.target)]); }}

);

D.

$(‘.Results’).onrowselected($.proxy($(this)

.find(‘input:checked’), function (e, sender) {

})

);

 

Correct Answer: C

 

 

QUESTION 143

You create an ASP.NET page. The page uses the jQuery $.ajax function to make calls back to the server in several places. You add the following div element to the page.

 

<div id=”errorInfo”>

 

</div>

 

You need to implement a single error handler that will add error information from all page $.ajax calls to the div named errorInfo.

 

What should you do?

 

A.

Add the following options to each $.ajax function call:

global: true,

error: function (XMLHttpRequest, textStatus, errorThrown){ $(“#errorInfo”).text (“<li>Error information is: ” + textStatus + “</li>”);

B.

Add the following code to the $(document).ready function on the page:

$(“#errorInfo”).ajaxError(function(event, request, settings){ $(this).append (“<li>Error requesting page ” + settings.url + “</li>”); });

C.

Add the following option to each $.ajax function call:

error: function (XMLHttpRequest, textStatus, errorThrown){ $(“#errorInfo”).text (“<li>Error information is: ” + textStatus + “</li>”); }

D.

Add the following code to the $(document).ready function on the page:

$.ajaxError(function(event, request, settings){

$(this).append(“<li>Error requesting page ” + settings.url + “</li>”);}); Add the following option to each $.ajax function call:

global: true

 

Correct Answer: B

 

 

QUESTION 144

You create a Web page that contains the span shown in the following line of code.

 

<span id=”span1″>Text</span>

 

You need to replace the contents of the span with HTML that you download from a URL specified by a global variable named localURL.

 

Which code segment should you use?

 

A.

$.ajax({

type: “GET”,

url: localURL,

dataType: “jsonp”,

success: function(htmlText) {

$(“#span1”).text(htmlText);

}

});

B.

$.ajax(localURL, {},

function(htmlText) {

$(“#span1”).html(htmlText);

},

“html”

);

C.

$.ajax({

type: “GET”,

url: localURL,

dataType: “html”,

success: function(htmlText) {

$(“#span1”).innerHTML = htmlText;

}

});

D.

$.ajax({

type: “GET”,

url: localURL,

success: function(htmlText) {

$(“#span1”).html(htmlText);

}

});

 

Correct Answer: D

Explanation:

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

Implementing AJAX with jQuery (page 536)

 

 

QUESTION 145

You are creating an ASP.NET Web site. The site contains pages that are available to anonymous users. The site also contains a page named Premium.aspx that provides premium content to only members of a group named Subscribers. You need to modify the web.config file to ensure that Premium.aspx can be accessed by only members of the Subscribers group. Which configuration should you use?

 

A.

<location path=”Premium.aspx”>

<system.web>

<authorization>

<allow users=”Subscribers”/>

<deny users=”*”/>

</authorization>

</system.web>

</location>

B.

<location path=”Premium.aspx”>

<system.web>

<authorization>

<allow roles=”Subscribers”/>

<deny users=”*”/>

</authorization>

</system.web>

</location>

C.

<location path=”Premium.aspx”>

<system.web>

<authorization>

<allow roles=”Subscribers”/>

<deny users=”?”/>

</authorization>

</system.web>

</location>

D.

<location path=”Premium.aspx”>

<system.web>

<authorization>

<deny users=”*”/>

<allow roles=”Subscribers”/>

</authorization>

</system.web>

</location>

 

Correct Answer: B

Explanation:

CHAPTER 13 Implementing User Profiles, Authentication, and Authorization Lesson 2: Using ASP.NET Membership

Restricting Access to ASP.NET Websites, Files, and Folders – Controlling Authorization for Folders and Files by Using .config Files (page 819)

 

 

QUESTION 146

You are implementing an ASP.NET Web site. The site uses a component that must be dynamically configured before it can be used within site pages.

 

You create a static method named SiteHelper.Configure that configures the component.

 

You need to add a code segment to the Global.asax file that invokes the SiteHelper.Configure method the first time, and only the first time, that any page in the site is requested.

 

Which code segment should you use?

 

A.

void Application_Start(object sender, EventArgs e) {

SiteHelper.Configure();

}

B.

void Application_Init(object sender, EventArgs e) {

SiteHelper.Configure();

}

C.

void Application_BeginRequest(object sender, EventArgs e) { SiteHelper.Configure();

}

D.

Object lockObject = new Object();

void Application_BeginRequest(object sender, EventArgs e) { lock(lockObject())

{

SiteHelper.Configure();

}

}

 

Correct Answer: A

 

 

QUESTION 147

You create a Visual Studio 2010 solution that includes a WCF service project and an ASP.NET project. The service includes a method named GetPeople that takes no arguments and returns an array of Person objects. The ASP.NET application uses a proxy class to access the service. You use the Add Service Reference wizard to generate the class. After you create the proxy, you move the service endpoint to a different port. You need to configure the client to use the new service address. In addition, you must change the implementation so that calls to the client proxy will return a List<Person> instead of an array. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

 

A.

In the context menu for the service reference in the ASP.NET project, select the Configure Service Reference command, and set the collection type to System.Collections.Generic.List.

B.

In the context menu for the service reference in the ASP.NET project, select the Update Service Reference command to retrieve the new service configuration.

C.

Change the service interface and implementation to return a List<Person>.

D.

Edit the address property of the endpoint element in the web.config file to use the new service address.

 

Correct Answer: AD

Explanation:

CHAPTER 10 Writing and Working with HTTP Modules and Web Services Lesson 3: Creating and Consuming WCF Services

Creating a WCF Service with ASP.NET (page 596)

 

 

QUESTION 148

You use the ASP.NET Web Site template to create a Web site that will be deployed to multiple locations. Each location will specify its SMTP configuration settings in a separate file named smtp.config in the root folder of the Web site. You need to ensure that the configuration settings that are specified in the smtp.config file will be applied to the Web site. Which configuration should you use in web.config?

 

A.

<configuration>

<system.net>

<mailSettings>

<smtp configSource=”smtp.config” allowOverride=”true”> <network host=”127.0.0.1″ port=”25″/>

</smtp>

</mailSettings>

</system.net>

</configuration>

B.

<configuration>

<system.net>

<mailSettings>

<smtp configSource=”smtp.config” />

</mailSettings>

</system.net>

</configuration>

C.

<configuration xmlns:xdt=”http://schemas.microsoft.com/XML- Document-Transform”> <location path=”smtp.config” xdt:Transform=”Replace” xdt:Locator=”Match (path)”>

<system.net />

</location>

</configuration>

D.

<configuration>

<location path=”smtp.config”>

<system.net>

<mailSettings>

<smtp Devilery Method=”Network” >

<Network Host = “127.0.0.1” Port=”25″/>

</smtp>

</mailSettings>

</system.net>

</location>

</configuration>

 

Correct Answer: B

Explanation:

CHAPTER 8 Debugging and Deploying

Lesson 3: Deploying Websites

Publishing Web Applications – Web.config Transformations (page 421)

 

 

QUESTION 149

You are developing an ASP.NET application by using Visual Studio 2010. You need to interactively debug the entire application. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

 

A.

Set the Debug attribute of the compilation node of the web.config file to true.

B.

Add a DebuggerDisplay attribute to the code-behind file of the page that you want to debug.

C.

Select the ASP.NET debugger option in the project properties.

D.

Define the DEBUG constant in the project settings.

 

Correct Answer: AC

 

 

QUESTION 150

You are preparing to deploy an ASP.NET application to a production server by publishing the application in Release configuration. You need to ensure that the connection string value that is stored in the web.config file is updated to the production server# s connection string value during publishing. What should you do?

 

A.

Add the following code to the web.config file.

<connectionStrings>

<add name=”DB” connectionString=”Server=ProdServer;Database=ProdDB;Integrated Security=SSPI;” providerName=”Release” />

</connectionStrings>

B.

Add the following code to the web.config file.

<connectionStrings>

<add name=”DB” connectionString=”Server=ProdServer;Database=ProdDB;Integrated Security=SSPI;” xdt:Transform=”Replace” xdt:Locator=”Match(name)” />

</connectionStrings>

C.

Add the following code to the web.release.config file.

<connectionStrings>

<add name=”DB” connectionString=”Server=ProdServer;Database=ProdDB;Integrated Security=SSPI;” providerName=”Release” />

</connectionStrings>

D.

Add the following code to the web.release.config file.

<connectionStrings>

<add name=”DB” connectionString=”Server=ProdServer;Database=ProdDB;Integrated Security=SSPI;” xdt:Transform=”Replace” xdt:Locator=”Match(name)” />

</connectionStrings>

 

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

HOT EXAM!

Name of author

Name: admin