microsoft press ebook mcts 70-515 [Apr 2016]

Exam Code: 70-515 (Practice Exam Latest Test Questions VCE PDF)
Exam Name: TS: Web Applications Development with Microsoft .NET Framework 4
Certification Provider: Microsoft
Free Today! Guaranteed Training- Pass 70-515 Exam.

2016 Apr 70-515 Study Guide Questions:

Q61. You are implementing an ASP.NET MVC 2 Web application that contains several folders. 

The Views/Shared/DisplayTemplates folder contains a templated helper named Score.ascx that performs custom formatting of integer values. 

The Models folder contains a class named Player with the following definition. 

public class Player 

public String Name { get; set; } 

public int LastScore { get; set; } 

public int HighScore { get; set; } 

You need to ensure that the custom formatting is applied to LastScore values when the HtmlHelper.DisplayForModel method is called for any view in the application that has a model of type Player. 

What should you do? 

A. Rename Score.ascx to LastScore.ascx. 

B. Move Score.ascx from the Views/Shared/DisplayTemplates folder to the Views/Player/DisplayTemplates folder. 

C. Add the following attribute to the LastScore property. [UIHint("Score")] 

D. Add the following attribute to the LastScore property. [Display(Name="LastScore", ShortName="Score")] 

Answer: C 


Q62. You are implementing an ASP.NET Dynamic Data Web site. The Web site includes a data context that enables automatic scaffolding for all tables in the data model. 

The Global.asax.vb file contains the following code segment. 

Public Shared Sub RegisterRoutes(ByVal routes As RouteCollection) 

routes.Add(New DynamicDataRoute("{table}/ListDetails.aspx") _ 

With 

.Action = PageAction.List, 

.ViewName = "ListDetails", 

.Model = DefaultModel 

}) 

routes.Add(New DynamicDataRoute("{table}/ListDetails.aspx") _ 

With 

.Action = PageAction.Details, 

.ViewName = "ListDetails", 

.Model = DefaultModel 

}) 


End Sub 


You need to display the items in a table named Products by using a custom layout. 

What should you do? 

A. Add a new Web page named Products.aspx to the Dynamic Data\PageTemplates folder of the Web site. 

B. Add a new folder named Products to the Dynamic Data\CustomPages folder of the Web site. Add a new Web page named ListDetails.aspx to the Products folder. 

C. Add a new Web user control named Products.ascx to the Dynamic Data\Filters folder of the Web site. In the code-behind file for the control, change the base class from UserControl to System.Web.DynamicData.QueryableFilterUserControl. 

D. Add a new Web user control named Products_ListDetails.ascx to the Dynamic Data\EntityTemplates folder of the Web site. In the code-behind file for the control, change the base class from UserControl toSystem.Web.DynamicData.EntityTemplateUserControl. 

Answer: B 


Q63. RAG DROP 

You have an ASP.NET web application that uses master pages and content pages. 

You must initialize and close multiple resources from different events. 

In what order do events in the master pages and content pages occur? 


Answer: 


Q64. You are implementing an ASP.NET Web site that uses a custom server control named Task. Task is defined as shown in the following list. 

.

Class name: Task 

Namespace: DevControls 

Assembly: TestServerControl.dll 

Base class: System.Web.UI.WebControls.WebControl 

You copy TestServerControl.dll to the Web sites Bin folder. 

You need to allow the Task control to be declaratively used on site pages that do not contain an explicit @ Register directive. 

Which configuration should you add to the web.config file? 

A. <appSettings> 

<add key="Dev:Task" 

value="DevControls, DevControls.Task"/> 

</appSettings> 


B. <compilation targetFramework="4.0" explicit="false"> 

<assemblies> 

<add assembly="TestServerControl" /> 


</assemblies> </compilation> 

C. <pages> 

<controls> 

<add assembly="TestServerControl" namespace="DevControls" 

tagPrefix="Dev"/> 

</controls> 

</pages> 


D. <pages> 

<tagMapping> 

<add tagType="System.Web.UI.WebControls.WebControl" 

mappedTagType="DevControls.Task"/> 

</tagMapping> 

</pages> 


Answer: C 


Q65. You are developing an ASP.NET Web page. 

The page uses the MicrosoftAjax.js script file and the MicrosoftAjaxWebForms.js script file. 

You need to ensure that both scripts are combined into a single script. 

Which markup should you use? 


A. <asp:ScriptManager ID="sm1" runat="server"> 

<CompositeScript> 

<Scripts> 

<asp:ScriptReference Name="MicrosoftAjax.js" /> 

<asp:ScriptReference Name="MicrosoftAjaxWebForms.js" /> 

</Scripts> 

</CompositeScript> 

</asp:ScriptManager> 


B. <asp:ScriptManager ID="sm1" runat="server"> 

<CompositeScript ScriptMode="Auto"> 

<Scripts> 

<asp:ScriptReference Name="MicrosoftAjax.js" /> 

<asp:ScriptReference Name="MicrosoftAjaxWebForms.js" /> 

</Scripts> 

</CompositeScript> 

</asp:ScriptManager> 


C. <asp:ScriptManager ID="sm1" runat="server"> 

<CompositeScript ScriptMode="Release"> 

<Scripts> 

<asp:ScriptReference Name="MicrosoftAjax.js" /> 

<asp:ScriptReference Name="MicrosoftAjaxWebForms.js" /> 

</Scripts> 

</CompositeScript> 

</asp:ScriptManager> 


D. <asp:ScriptManager ID="sm1" runat="server"> 

<Scripts> 

<asp:ScriptReference Name="MicrosoftAjax.js" /> 

<asp:ScriptReference Name="MicrosoftAjaxWebForms.js" /> 

</Scripts> 

</asp:ScriptManager> 


Answer: A 


70-515 test questions

Up to the minute questions and answers 70-515:

Q66. 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> 


Answer: D 


Q67. You are creating an ASP.NET Web site. You create a HTTP module named CustomModule, and you register the module in the web.config file. The CustomModule class contains the following code. 

public class CustomModule : IHttpModule 

string footerContent = "<div>Footer Content</div>"; 

public void Dispose( ) {} 

You need to add code to CustomModule to append the footer content to each processed ASP.NET page. 

Which code segment should you use? 

A. public CustomModule(HttpApplication app) 

app.EndRequest += new EventHandler(app_EndRequest); 

void app_EndRequest(object sender, EventArgs e) 

HttpApplication app = sender as HttpApplication; 

app.Response.Write(footerContent); 


B. public void Init(HttpApplication app) { 

app.EndRequest += new EventHandler(app_EndRequest); 

void app_EndRequest(object sender, EventArgs e) 

HttpApplication app = new HttpApplication(); 

app.Response.Write(footerContent); 


C. public CustomModule() 

HttpApplication app = new HttpApplication(); 

app.EndRequest += new EventHandler(app_EndRequest); } 

void app_EndRequest(object sender, EventArgs e) 


HttpApplication app = sender as HttpApplication; 

app.Response.Write(footerContent); 


D. public void Init(HttpApplication app) 

app.EndRequest += new EventHandler(app_EndRequest); } 

void app_EndRequest(object sender, EventArgs e) 

HttpApplication app = sender as HttpApplication; 

app.Response.Write(footerContent); } 


Answer: D 


Q68. You are implementing an ASP.NET MVC 2 application. In the Areas folder, you add a subfolder named Product to create a single project area. 

You add files named ProductController.vb and Index.aspx to the appropriate subfolders. 

You then add a file named Route.vb to the Product folder that contains the following code. (Line numbers are included for reference only.) 

01 Public Class Route 

Inherits AreaRegistration 

02 

03 Public Overrides ReadOnly Property AreaName As String 

04 Get 

05 Return "product" 

06 End Get 

07 End Property 

08 

09 Public Overrides Sub RegisterArea( 


ByVal context As AreaRegistrationContext) 

10 

11 context.MapRoute("product_default", 


"product/{controller}/{action}/{id}", 

New With {.controller = "Product", .action = "Index", 

.id = ""}) 


12 


13 End Sub 

End Class 

When you load the URL http://<applicationname>/product, you discover that the correct page is not returned. You need to ensure that the correct page is returned. 

What should you do? 

A. Replace line 11 with the following code segment. 

context.MapRoute("product_default", 

"{area}/{controller}/{action}/{id}", 

New With {.area = "product", .controller = "Product", 

.action = "Index", .id = ""}) 


B. Replace line 11 with the following code segment. 

context.MapRoute("product_default", 

"{area}", 

New With {.controller = "Product", .action = "Index", .id = ""}) 


C. Add the following code segment at line 12. 

AreaRegistration.RegisterAllAreas() 


D. Add the following code segment to the RegisterRoutes method in the Global.asax.vb 

file. 

AreaRegistration.RegisterAllAreas() 


Answer: D 


Q69. You are developing an ASP.NET Web page that uses jQuery validation. 

The user should enter a valid email address in a text box that has ID txtEmail. The page must display "E-Mail 

address required" when the user does not enter an address and "Invalid e-mail address" when the user enters an address that is not formatted properly. 

You need to ensure that the appropriate error message is displayed when the text box does not contain a valid e-mail address. 

Which two code segments should you add? (Choose 2) 

A. txtEmail: 

messages: 

required: "E-mail address required", 

email: "Invalid e-mail address" 


B. 

messages: 

txtEmail: 

required: "E-mail address required", 

email: "Invalid e-mail address" 


C. 

txtEmail: { rules: { required: true email: true } } 

D. 

rules: 

txtEmail: 


required: true email: true } } 

Answer: BD 


Q70. Which property of the Label control gets\sets the identifer for a server control that the Label control is associated with? 

A. ClientID 

B. ID 

C. AssociatedControlID 

D. ControlID 

Answer: C 


70-515 practice test

Free 70-515 dumps free download:

Q71. You are developing an ASP.NET MVC 2 Web application. 

A page makes an AJAX request and expects a list of company names in the following format. 

["Adventure Works","Contoso"] 

You need to write an action method that returns the response in the correct format. 

Which type should you return from the action method? 

A. AjaxHelper 

B. XDocument 

C. JsonResult 

D. DataContractJsonSerializer 

Answer: C 


Q72. 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. 

Answer: AD 


Q73. A library called contosobuisness.dll has been created and u need to accept it in a page.. 

all options had the <%assembly tag but the att differed 

A. <%assembly TargetName="contosobuisness" %> 

B. <%assembly ID="contosobuisness" %> 

C. <%@ Assembly Name="contosobuisness" %> 

D. <%assembly virtualpath="contosobuisness" %> 

Answer: C 


Q74. You are developing an ASP.NET MVC 2 Web application. The application contains a controller named HomeController, which has an action named Index. The application also contains a separate area named Blog. A view within the Blog area must contain an ActionLink that will link to the Index action of the HomeController. You need to ensure that the ActionLink in the Blog area links to the Index action of the HomeController. Which ActionLink should you use? 

A. Html.ActionLink("Home", "Index", "Home") 

B. Html.ActionLink("Home", "Index", "Home", New With {.area = ""}, Nothing) 

C. Html.ActionLink("Home", "Index", "Home", New With {.area = "Blog"}, Nothing) 

D. Html.ActionLink("Home", "Index", "Home", New With {.area = "Home"}, Nothing) 

Answer: B 


Q75. You create an ASP.NET MVC 2 Web application. You implement a single project area in the application. In the Areas folder, you add a subfolder named Test. You add files named TestController.cs and Details.aspx to the appropriate subfolders. 

You register the area's route, setting the route name to test_default and the area name to test. You create a view named Info.aspx that is outside the test areA. You need to add a link to Info.aspx that points to Details. aspx. 

Which code segment should you use? 

A. <%= Html.RouteLink("Test", "test_default", new {area = "test"}, null) %> 

B. <%= Html.ActionLink("Test", "Details", "Test", new {area = "test"}, null) %> 

C. <a href="<%= Html.RouteLink("Test", "test_default", new {area = "test"}, null) %>">Test</a> 

D. <a href="<%= Html.ActionLink("Test", "Details", "Test", new {area = "test"}, null) %>">Test</a> 

Answer: B 



see more http://www.certshared.com/exam/70-515/

Microsoft 70-515 Certification Sample Questions and Answers: http://www.braindumpsall.net/70-515-dumps/

P.S. New 70-515 dumps PDF: http://www.4easydumps.com/70-515-dumps-download.html