70-515 item pool(211 to 225) for client: Apr 2016 Edition

Virtual of 70-515 brain dumps materials and item pool for Microsoft certification for IT examinee, Real Success Guaranteed with Updated 70-515 pdf dumps vce Materials. 100% PASS TS: Web Applications Development with Microsoft .NET Framework 4 exam Today!

2016 Apr 70-515 Study Guide Questions:

Q211. You are developing an ASP.NET MVC 2 application. A view contains a form that allows users to submit their first name. You need to display the value that is submitted, and you must ensure that your code avoids cross-site scripting. Which code segment should you use? 

A. <%: Model.FirstName %> 

B. <%= Model.FirstName %> 

C. <% Response.Write(Model.FirstName); %> 

D. <% Response.Write(HttpUtility.HtmlDecode(Model.FirstName)); %> 

Answer: A 


Q212. You are implementing an ASP.NET page. You add and configure the following ObjectDataSource. 

<asp:ObjectDataSource SelectMethod="GetProductByProductId" ID="odc" runat="server" TypeName="ProductDAL"> <SelectParameters> <asp:Parameter Name="productId" Type="Int32" /> 

</SelectParameters> 

</asp:ObjectDataSource> 

The page will be called with a query string field named pid. 

You need to configure the ObjectDataSource control to pass the value of the pid field to GetProductsByProductId method. 

What should you do? 

A. Replace the asp:Parameter with the following declaration. 

<asp:QueryStringParameter DefaultValue="pid" Name="productId" 

Type="Int32" /> 


B. Replace the asp:Parameter with the following declaration. 

<asp:QueryStringParameter QueryStringField="pid" Name="productId" Type="Int32" / 


C. Add the following event handler to the Selecting event of the ObjectDataSource control. 

Private Sub odc_Selecting(ByVal sender As Object, 

ByVal e As _ 

System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs) _ 

Handles odc.Selecting 


D. InputParameters("pid") = Request.QueryString("productId") 

End Sub 


E. Add the following code segment to the pages code-behind. 

Protected Sub Page_Load(ByVal sender As Object, 

ByVal e As System.EventArgs) Handles Me.Load 

odc.SelectParameters.Add("productId", Request.QueryString("pid")) 

End Sub 


Answer: B 


Q213. You are developing an ASP.NET Web application. 

The application includes the following Entity Data Mmodel (EDM) 


You instantiate an ObjectContext for the EDM named context 

You need to find the total number of addresses that are assosiated with customers that have a no-null mode. 

Which LINQ to Entities query should you use? 

A. var query = context.Customers 

.Where(c => c.MiddleName != null) 

.Select(c => c.CustomerAddresses.Count(); 


B. var query = context.Customers 

.Where(c => c.MiddleName != null) 

.SelectMany(c => c.CustomerAddresses.Count(); 


C. var query = context.Addresses 

.SelectMany(a => a.CustomerAddresses.OfType<Customer>() 

.Where(c => c.MiddleName != null)).Count(); 


D. var query = context.Addresses 

.GroupBy(a => a.CustomerAddresses 

.Where(ca => ca.Customer.MiddleName != null)).Count(); 


Answer: D 


Q214. You are deploying an ASP.NET Web application to a remote server. You need to choose a deployment method that will ensure that all IIS settings, in addition to the Web content, will deploy to the remote server. Which deployment method should you choose? 

A. the XCOPY command-line tool 

B. the Copy Web Site tool 

C. the Web Deployment tool 

D. the Publish Web Site utility 

Answer: C 


Q215. You are developing an ASP.NET Web application. Application data is stored in a Microsoft SQL Server 2008 database. You configure a connection string named cnnContoso. The application must cache the data that is returned from the database by using this connection string. 

You need to ensure that the application checks the database every 10 seconds. What should you do? 

A. Add the following configuration to the <system.web> section of the web.config file. 

<caching> 

<outputCacheSettings> 

<outputCacheProfiles> 

<add name="cnnContoso" 

duration="10" /> 

</outputCacheProfiles> 

</outputCacheSettings> 


</caching> 

B. Add the following configuration to the <system.web> section of the web.config file. 

<caching> 

<sqlCacheDependency enabled="true" pollTime="10000"> 

<databases> 

<add name="ContosoDatabase" 

connectionStringName="cnnContoso" /> 

</databases> 

</sqlCacheDependency> 

</caching> 


C. Add the following @ Page directive to pages that query the database. 

<%@ OutputCache Duration="10" 

VaryByParam="cnnContoso" %> 


D. Add the following @ Page directive to pages that query the database. 

<%@ OutputCache Duration="10000" 

VaryByParam="cnnContoso" %> 


Answer: B 


70-515  brain dumps

Up to date 70-515 braindumps:

Q216. You create an ASP.NET page named TestPage.aspx that contains validation controls. You need to verify that all input values submitted by the user have been validated by testing the Page.IsValid property. Which page event should you add an event handler to? 

A. Init 

B. Load 

C. PreInit 

D. PreLoad 

Answer: B 


Q217. You are troubleshooting an ASP.NET Web application. System administrators have recently expanded your web farm from one to two servers. Users are periodically reporting an error message about invalid view state. You need to fix the problem. What should you do? 

A. Set viewStateEncryptionMode to Auto in web.config on both servers. 

B. Set the machineKey in machine.config to the same value on both servers. 

C. Change the session state mode to SQLServer on both servers and ensure both servers use the same connection string. 

D. Override the SavePageStateToPersistenceMedium and LoadPageStateFromPersistenceMedium methods in the page base class to serialize the view state to a local web server file. 

Answer: B 


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


Q219. You are implementing a method in an ASP.NET application that includes the following requirements. Store the number of active bugs in the cache. The value should remain in the cache when there are calls more often than every 15 seconds. The value should be removed from the cache after 60 seconds. You need to add code to meet the requirements. Which code segment should you add? 

A. Cache.Insert("ActiveBugs", result, Nothing, DateTime.Now.AddSeconds(60), TimeSpan.FromSeconds(15)) 

B. Cache.Insert("Trigger", DateTime.Now, NothingDateTime.Now.AddSeconds(60), 

Cache.NoSlidingExpiration) Dim cd As CacheDependency = New 

CacheDependency(Nothing, 

New String() {"Trigger"}) 

Cache.Insert("ActiveBugs", result, cd, Cache.NoAbsoluteExpiration, 

TimeSpan.FromSeconds(15)) 


C. Cache.Insert("ActiveBugs", result, Nothing, Cache.NoAbsoluteExpiration, 

TimeSpan.FromSeconds(15)) 

Dim cd As CacheDependency = New CacheDependency(Nothing, 

New String() {"ActiveBugs"}) 

Cache.Insert("Trigger", DateTime.Now, cd, DateTime.Now.AddSeconds(60), 

Cache.NoSlidingExpiration) 


D. Dim cd As CacheDependency = New CacheDependency(Nothing, 

New String() {"Trigger"}) 

Cache.Insert("Trigger", DateTime.Now, Nothing, 

DateTime.Now.AddSeconds(60), Cache.NoSlidingExpiration) 

Cache.Insert("ActiveBugs", result, cd, Cache.NoAbsoluteExpiration, 

TimeSpan.FromSeconds(15)) 


Answer: B 


Q220. You are implementing an ASP.NET MVC 2 Web application that contains the following class. 

Public Class DepartmentController Inherits Controller 

Shared departments As List(Of Department) = 

New List(Of Department) 

Function Index() As ActionResult Return View(departments) 

End Function 

Function Details(ByVal id As Integer) As ActionResult 

Return View(departments.Find(Function(x) x.ID = id)) 

End Function 

Function ListEmployees(ByVal d As Department) As ActionResult 

Dim employees As List(Of Employee) = GetEmployees(d) 

Return View (employees) 

End Function 

End Class 

You create a strongly typed view that displays details for a Department instance. You want the view to also include a listing of department employees. 

You need to write a code segment that will call the ListEmployees action method and output the results in place. 

Which code segment should you use? 

A. <%= Html.Action("ListEmployees", Model) %> 

B. <%= Html.ActionLink("ListEmployees", "Department", "DepartmentController") %> 

C. <% Html.RenderPartial("ListEmployees", Model) %> 

D. <%= Html.DisplayForModel("ListEmployees") %> 


Answer: A 


certleader.com

Exact 70-515 practice:

Q221. You are developing an ASP.NET Web page that contains input controls, validation controls, and a button named btnSubmit. 

The page has the following code-behind. (Line numbers are included for reference only.) 

01 public partial class _Default : System.Web.UI.Page 

02 { 

03 protected void SaveToDatabase() 


04 { 

05 

06 } 

07 

08 protected void btnSubmit_Click(object sender, 

EventArgs e) 

09 { 

10 

11 } 

12 } 

You need to ensure that all data that is submitted passes validation before the data is saved in a database. 

What should you do? 

A. Add the following method override. 

protected override void OnInit(EventArgs e) 

base.OnInit(e); 

if (Page.IsValid) this.SaveToDatabase(); 


B. Add the following method override. 

protected override void OnLoad(EventArgs e) 

base.OnLoad(e); 

if (Page.IsValid) this.SaveToDatabase(); 


C. Add the following method override. 

protected override void OnPreRender(EventArgs e) 

base.OnPreRender(e); 

if (Page.IsValid) this.SaveToDatabase(); 


D. Add the following code segment at line 10. 

if (Page.IsValid) this.SaveToDatabase(); 


Answer: D 


Q222. You work as an ASP.NET Web Application Developer for SomeCompany. 

The company uses Visual Studio .NET 2010 as its application development platform. 

You create an ASP.NET MVC 2 Web application using .NET Framework 4.0. 


You implement a single project area in the MVC 2 Web application. 

In the Areas folder, you add a subfolder named MyTest. 

You add the following files to the appropriate sub-folders: 


MyController. cs 

MyHome.aspx 


You register a route of the area, setting the route name to MyTest_default and the area 

name to test. 

You create a view named MyViews.aspx that is outside the test area. 

You need to add a link to MyViews.aspx that points to MyHome.aspx. 


Which of the following code segments will you use? 


A. <%= Html.ActionLink("MyTest", "MyHome", new {area = "test"}, null)%> 

B. <%= Html.RouteLink("MyHome", "MyTest", new {area = "test"}, null)%> 

C. <%= Html.RouteLink("MyTest", "MyHome", "MyTest", new {area = "test"}, null)%> 

D. <%= Html.ActionLink("MyTest", "MyHome", "MyTest", new {area = "test"}, null)%> 

Answer: D 


Q223. You are implementing a read-only page that includes the following controls. 


You disable view state to improve performance. You need to ensure that the page is updated to display the latest data when the user clicks the refresh button. 

Which code segment should you use? 

A. protected void Page_PreInit(object sender, EventArgs e) 

if (!IsPostBack) 

gvCustomers.DataSource = GetCustomers(); 

gvCustomers.DataBind(); 


B. protected void Page_Load(object sender, EventArgs e) 

gvCustomers.DataSource = GetCustomers(); 

gvCustomers.DataBind(); 


C. protected void gvCustomers_DataBinding(object sender, EventArgs e) 

gvCustomers.DataSource = GetCustomers(); 

gvCustomers.DataBind(); 


D. protected void Page_PreRender(object sender, EventArgs e) 

if (!IsPostBack) 


gvCustomers.DataSource = GetCustomers(); 

gvCustomers.DataBind(); 


Answer: B 


Q224. You are implementing a WCF service library. You add a new code file that contains the following code segment. 


You build the service library and deploy its assembly to an IIS application. 

You need to ensure that the GetCurrentRate method can be called from JavaScript. 

What should you do? 

A. Add a file named Service.svc to the IIS application. 

Add the following code segment to the file. 

<%@ ServiceHost Service="ContosoWCF.IRateService" 

Factory="System.ServiceModel.Activation.WebScriptServiceHostFactory" 

%> 


B. Add a file named Service.svc to the IIS application. 

Add the following code segment to the file. 

<%@ ServiceHost Service="ContosoWCF.RateService" 

Factory="System.ServiceModel.Activation.WebScriptServiceHostFactory" 

%> 


C. Apply the ScriptService attribute to the RateService class. Rebuild the WCF service 

library, and redeploy the assembly to the IIS application. 


D. Apply the WebGet attribute to the GetCurrentRate interface method. Rebuild the WCF 

service library, and redeploy the assembly to the IIS application. 


Answer: B 


Q225. You're developing an ASP web page. the pages requires access to types that are defined in an assembly named Contoso.businessobjects.dll. 

You need to ensure that the page can access these types. 

A. <%@ assembly ID= "Contoso.bussinessobjects" %> 

B. <%@ assembly target name= "Contoso.bussinessobjects" %> 

C. <%@ assembly name= "Contoso.bussinessobjects" %> 

D. <%@ assenbly Virtual Path= "Contoso.bussinessobjects" %> 

Answer: C 



see more 70-515 dumps