Jun 2016 updated: sample 70-515 questions

The 70-515 software regarding Pass4sure may examine any testee whether or not to grasp the actual TS: Web Applications Development with Microsoft .NET Framework 4 understanding securely and also real answers. The Pass4sure 70-515 items are contain several choose. Prospect can pick diverse bundle goods for your 70-515 pdf or 70-515 vce software based on their very own grasp of the 70-515 scenario.

2016 Jun 70-515 exam

Q196. You are developing an ASP.NET web page. 

The page includes the following EntityDataSource control: 

<asp:EntityDataSource ID="EntityDataSource1" runat="server" 

ConnectionString="name=AdventureWorksEntities" 

DefaultContainerName="AdventureWorksEntities" EnableFlattening="False" 

EntitySetName="Products" /> 

The page must filter the data that is displayed in a grid based on a query string parameter named ProductPrefix. 

The grid must display products whose ProductName starts with the query string value. 

You need to ensure that the page generates the appropriate database query. 

What should you do? 

A. Add the following element to the EntityDataSource control: 

<WhereParameters> 

<asp:DynamicQueryStringParameter QueryStringField="ProductPrefix" 

Name="ProductName" /> 

</WhereParameters> 


B. Add the following element to the EntityDataSource control: 

<WhereParameters> 

<asp:QueryStringParameter QueryStringField="ProductPrefix" 

Name="ProductName" /> 

</WhereParameters> 


C. Add the following element to the EntityDataSource control: 

<asp:QueryExtender ID="QueryExtender1" runat="server" 

TargetControlID="EntityDataSource1"> 

<asp:PropertyExpression Name="ProductName" /> 

<asp:DynamicFilterExpression ControlID="ProductPrefix" /> 

</asp:QueryExtender> 


D. Add the following element to the EntityDataSource control: 

<asp:QueryExtender ID="QueryExtender1" runat="server" 

TargetControlID="EntityDataSource1"> 

<asp:SearchExpression SearchType="StartsWith" DataFields="ProductName"> 

<asp:QueryStringParameter QueryStringField="ProductPrefix" /> 

</asp:SearchExpression> 

</asp:QueryExtender> 


Answer: D 


Q197. 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 Class _Default 02 Inherits System.Web.UI.Page 03 04 Protected Sub SaveToDatabase() 05 06 End Sub 07 08 Protected Sub btnSubmit_Click(ByVal sender As Object, 09 ByVal e As EventArgs) Handles btnSubmit.Click 10 11 End Sub 12 13 End Class 

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 Overrides Sub OnInit(ByVal e As EventArgs) 

MyBase.OnInit(e) 

If (Page.IsValid) Then Me.SaveToDatabase() 

End Sub 


B. Add the following method override. 

Protected Overrides Sub OnLoad(ByVal e As EventArgs) 

MyBase.OnLoad(e) 

If (Page.IsValid) Then Me.SaveToDatabase() 

End Sub 


C. Add the following method override. 

Protected Overrides Sub OnPreRender(ByVal e As EventArgs) 

MyBase.OnPreRender(e) 

If (Page.IsValid) Then Me.SaveToDatabase() 

End Sub 


D. Add the following code segment at line 10. 

If (Page.IsValid) Then Me.SaveToDatabase() 

Answer: D 


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


Q199. You have created an ASP.NET server control named ShoppingCart for use by other developers. Some developers report that the ShoppingCart control does not function properly with ViewState disabled. You want to ensure that all instances of the ShoppingCart control work even if ViewState is disabled. What should you do? 

A. Require developers to set EnableViewStateMac to true. 

B. Store state in ControlState instead of ViewState. 

C. Serialize the state into an Application state entry called "MyControl". 

D. Require developers to change the session state mode to SQLServer. 

Answer: B 


Q200. You are developing an ASP.NET template server control. 

You need to ensure that a new ID namespace is created within the page control hierarchy when the control. 

Which interface should you implement on the control? 

A. DataItemContainer 

B. NamingContainer 

C. DataKeysControl 

D. ExtenderControl 

Answer: B 


Q201. You use the ASP.NET Web Application template to create an application in a new Visual Studio solution. The project uses types that are defined in a class library project. Source code for the class library is frequently modified. You need to ensure that classes in the Web application project always reference the most recent version of the class library types. What should you do? 

A. Add the class library project to the solution. Modify the class library project to add a reference to the Web application project. 

B. Add the class library project to the solution. Modify the Web application project to add a reference to the class library project. 

C. Add a post-build step to the Web application project that copies the most recent version of the class library assembly to the bin folder of the Web application. 

D. Add a post-build step to the class library project that copies the most recent version of the class library assembly to the App_Code folder of the Web application. In the <compilation /> section of the web.config file, add an <assembly /> entry that specifies the location of the class library assembly. 

Answer: B 


Q202. 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 Private Sub gvModels_RowDataBound(ByVal sender As Object, _ 02 ByVal e As GridViewRowEventArgs) _ 03 Handles gvModels.RowDataBound 04 If (e.Row.RowType = DataControlRowType.DataRow) Then 05 Dim cm As CarModel = 06 DirectCast(e.Row.DataItem, CarModel) 07 08 img.ImageUrl = 09 String.Format("images/{0}.jpg", cm.ID) 10 11 End If 12 End Sub 

You need to get a reference to the Image named img. 

Which code segment should you add at line 07? 

A. Dim img As Image = DirectCast(Page.FindControl("img"), Image) 

B. Dim img As Image = DirectCast(e.Row.FindControl("img"), Image) 

C. Dim img As Image = DirectCast(gvModels.FindControl("img"), Image) 

D. Dim img As Image = DirectCast(Page.Form.FindControl("img"), Image) 

Answer: B 


70-515  exam prep

Latest latest dumps for 70-515:

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


Q204. You are implementing an ASP.NET page. Client-side script requires data. 

Your application includes a class named Person with a Name property of type string. 

The code-behind file of the page includes the following code segment. 

Public JsonValue As String 

Dim people As List(Of Person) = GetPeopleList() 

Dim json As JavaScriptSerializer = New JavaScriptSerializer() 

You need to use the JavaScriptSerializer class to serialize only the value of the Name property of each item in the people list. 

Which code segment should you use? 

A. JsonValue = json.Serialize(people.Select(Function(p) p.Name)) 

B. Dim names = From person In people Select person JsonValue = "{" & json.Serialize(names) & "}" 

C. JsonValue = json.Serialize(people.SelectMany( Function(p) p.Name.AsEnumerable())) 

D. Dim names = From person In people Select person JsonValue = json.Serialize(names) 

Answer: A 


Q205. You create a Web page that has an ASP.NET menu. You need to ensure that the menu items are populated from an array of strings in your code-behind file. What should you do? 

A. Write a JavaScript function that uses document.write to write out an asp:MenuItem for each string array element. 

B. In the Page_Render handler, use Response.Write to write out an asp:MenuItem for each string array element. 

C. Set the DataSource attribute of asp:Menu to the name of the array. 

D. In the Page_Load handler, create an instance of asp:MenuItem for each string array element, and add each of these instances to the menu's Items collection. 

Answer: D 


Q206. You are implementing an ASP.NET page that includes the following down list. 


You need to dynamically add values to the end of the drop-down list. 

What should you do? 

A. Add the following OnPreRender event handler to the asp:DropDownList 

protected void MyDropDown_PreRender(object sender, EventArgs e) 

DropDownList ddl = sender as DropDownList; 

Label lbl = new Label(); 

lbl.Text = "Option"; 


lbl.ID = "Option"; ddl.Controls.Add(lbl); } 

B. Add the following OnPreRender event handler to the asp:DropDownList 

protected void MyDropDown_PreRender(object sender, EventArgs e) 

DropDownList ddl = sender as DropDownList; 

ddl.Items.Add("Option"); 


C. Add the following event handler to the page code-behind. 

protected void Page_LoadComplete(object sender, EventArgs e) 

DropDownList ddl = Page.FindControl("MyDropDown") as DropDownList; 

Label lbl = new Label(); 

lbl.Text = "Option"; 

lbl.ID = "Option"; 

ddl.Controls.Add(lbl); 


D. Add the following event handler to the page code-behind. 

protected void Page_LoadComplete(object sender, EventArgs e) 

DropDownList ddl = Page.FindControl("MyDropDown") as DropDownList; 

ddl.Items.Add("Option"); 


Answer: B 


Q207. You are debugging an ASP.NET web page. The page includes the following method: 

[WebMethod] 

public string GetServerString() { ... } 

The page also includes the following markup: 

<asp:ScriptManager ID="sm1" runat="server" /> 


The following JavaScript code is used to call the GetServerString method: 

function GetString() 


PageMethods.GetServerString(callbackMethod); 

function callbackMethod(str) 


... 


The AJAX calls to the GetServerString method are failing. 

You need to ensure that the AJAX call to the GetServerString method succeeds. 

Which two actions should you perform? 

(Each correct answer presents part of the solution. Choose two.) 


A. Set the EnablePageMethods property of the ScriptManager control to true. 

B. Set the EnablePartialRendering property of the ScriptManager control to true. 

C. Change the WebMethod attribute of the GetServerString method to WebMethod (EnableSession= true). 

D. Declare the GetServerString method as static. 

Answer: AD 


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


Answer: C 


Q209. State management 

You have to store user data of 200 KB in an object. 

Which state management technique to use: 

A. Server session 

B. Cookie 

C. ViewState 

D. Hidden Field 

Answer: A 


Q210. 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); 

}); 


Answer: D 



see more 70-515 dumps