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

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

Ensurepass

QUESTION 61

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 62

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.

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) SiteHelper.Configure()

End Sub

B.

Sub Application_Init(ByVal sender As Object, ByVal e As EventArgs) SiteHelper.Configure()

End Sub

C.

Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)

SiteHelper.Configure()

End Sub

D.

Dim lockObject As Object = New Object()

Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)

SyncLock (lockObject())

SiteHelper.Configure()

End SyncLock

End Sub

 

Correct Answer: A

 

 

QUESTION 63

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(Of 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(Of 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 64

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 65

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 66

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

 

 

QUESTION 67

You are implementing an ASP.NET application. The application includes a Person class with property Age. You add a page in which you get a list of Person objects and display the objects in a GridView control. You need to add code so that the GridView row is highlighted in red if the age of the person is less than 18. Which GridView event should you handle?

 

A.

RowDataBound

B.

RowCommand

C.

RowUpdated

D.

RowEditing

 

Correct Answer: A

 

 

QUESTION 68

You are implementing an ASP.NET page that will retrieve large sets of data from a data source. You add a ListView control and a DataPager control to the page. You need to ensure that the data can be viewed one page at a time. What should you do?

 

A.

Set the DataPager control’s PageSize property to the number of rows to view at one time.

B.

Set the DataPager control’s PagedControlID property to the ID of the ListView control.

C.

In the codebehind file, set the DataPager control’s Parent property to the ListView control.

D.

In the codebehind file, set the ListView control’s Parent property to the DataPager control.

 

Correct Answer: B

 

 

QUESTION 69

You are implementing an ASP.NET application that uses LINQ to Entities to access and update the database.

 

The application includes the following method to update a detached entity of type Person.

 

private NorthwindContext _entities;

 

public void UpdatePerson(Person personToEdit)

 

{

 

}

 

You need to implement the UpdatePerson method to update the database row that corresponds to the personToEdit object.

 

Which code segment should you use?

 

A.

_entities.People.Attach(personToEdit);

_entities.ObjectStateManager.ChangeObjectState(

personToEdit,

EntityState.Modified);

_entities.SaveChanges();

B.

_entities.ObjectStateManager.ChangeObjectState( personToEdit,

EntityState.Added);

_entities.SaveChanges();

C.

_entities.People.ApplyCurrentValues(personToEdit);

_entities.SaveChanges();

D.

_entities.People.Attach(new Person() { Id = personToEdit.Id });

_entities.ObjectStateManager.

ChangeObjectState(

personToEdit,

EntityState.Modified);

_entities.SaveChanges();

 

Correct Answer: A

Explanation:

Table(Of TEntity).Attach Method (TEntity)

(http://msdn.microsoft.com/en-us/library/bb300517.aspx)

 

 

QUESTION 70

You are implementing an ASP.NET Web site. The Web site contains a Web service named CustomerService.

 

The code-behind file for the CustomerService class contains the following code segment.

 

public class ProductService : System.Web.Services.WebService

 

{

 

public List<Product> GetProducts(int categoryID)

 

{

 

return GetProductsFromDatabase(categoryID);

 

}

 

}

 

You need to ensure that the GetProducts method can be called by using AJAX. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

 

A.

Apply the WebService attribute to the ProductService class.

B.

Apply the ScriptService attribute to the ProductService class.

C.

Apply the WebMethod attribute to the GetProducts method.

D.

Apply the ScriptMethod attribute to the GetProducts method.

 

Correct Answer: BC

Explanation:

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

Calling a Web Service with $.ajax() (page 535)

CHAPTER 10 Writing and Working with HTTP Modules and Web Services Lesson 2: Creating and Consuming XML Web Services Calling a Web Service from Client Script by Using AJAX (page 583-584)

 

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