15 tips on How to 70-515 Test Like a Badass [121 to 135]

★ Pass on Your First TRY ★ 100% Money Back Guarantee ★ Realistic Practice Exam Questions

Free Instant Download NEW 70-515 Exam Dumps (PDF & VCE):
Available on: https://www.certleader.com/70-515-dumps.html


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:

Q121. You are implementing an ASP.NET application that uses data-bound GridView controls in multiple pages. You add JavaScript code to periodically update specific types of data items in these GridView controls. You need to ensure that the JavaScript code can locate the HTML elements created for each row in these GridView controls, without needing to be changed if the controls are moved from one page to another. 

What should you do? 

A. Replace the GridView control with a ListView control. 

B. Set the ClientIDMode attribute to Predictable in the web.config file. 

C. Set the ClientIDRowSuffix attribute of each unique GridView control to a different value. 

D. Set the @ OutputCache directive's VaryByControl attribute to the ID of the GridView control. 


Answer: C 


Q122. 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 {area = ""}, null) 

C. Html.ActionLink("Home", "Index", "Home", new {area = "Blog"}, null) 

D. Html.ActionLink("Home", "Index", "Home", new {area = "Home"}, null) 

Answer: B 


Q123. 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(); 


Answer: A 


Q124. You are implementing an ASP.NET Web site. The root directory of the site contains a page named Error.aspx. 

You need to display the Error.aspx page if an unhandled error occurs on any page within the site. 

You also must ensure that the original URL in the browser is not changed. What should you do? 

A. Add the following configuration to the web.config file. 

<system.web> 

<customErrors mode="On"> 

<error statusCode="500" redirect="~/Error.aspx" /> 

</customErrors> 

</system.web> 


B. Add the following configuration to the web.config file. 

<system.web> 

<customErrors redirectMode="ResponseRewrite" 

mode="On" defaultRedirect="~/Error.aspx" /> 

</system.web> 


C. Add the following code segment to the Global.asax file. 

void Application_Error(object sender, EventArgs e) 

Response.Redirect("~/Error.aspx"); 


D. Add the following code segment to the Global.asax file. 

void Page_Error(object sender, EventArgs e) 

Server.Transfer("~/Error.aspx"); 


Answer: B 


Q125. 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 actual test

Up to the minute 70-515 test questions:

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


Q127. Which directive defines master page-precise attributes that are used by the ASP.NET page parser and compiler? 

A. @ MasterType 

B. @ Master 

C. @ PageType 

D. @ MasterPage 

Answer: B 


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

You need to ensure that content flows from right to left. 

What should you do? 

A. In the @Page directive, add an attribute named dir with a value of “RightToLeft” 

B. In the @Page directive, add an attribute named dir with a value of “RTL” 

C. In the <html> tag, add an attribute named dir with a value of “RTL” 

D. In the <html> tag, add an attribute named dir with a value of “RightToLeft” 

Answer: C 


Q129. You are implementing an ASP.NET Web site. The site allows users to explicitly choose the display language for the site# s Web pages. You create a Web page that contains a DropDownList named ddlLanguage, as shown in the following code segment. 

<asp:DropDownList ID="ddlLanguage" runat="server" AutoPostBack="True" 

ClientIDMode="Static" OnSelectedIndexChanged="SelectedLanguageChanged"> 

<asp:ListItem Value="en">English</asp:ListItem> 

<asp:ListItem Value="es">Spanish</asp:ListItem> 

<asp:ListItem Value="fr">French</asp:ListItem> 

<asp:ListItem Value="de">German</asp:ListItem> 

</asp:DropDownList> 


The site contains localized resources for all page content that must be translated into the language that is selected by the user. 

You need to add code to ensure that the page displays content in the selected language if the user selects a language in the drop-down list. 

Which code segment should you use? 

A. Protected Sub SelectedLanguageChanged(ByVal sender As Object, 

ByVal e As EventArgs) Handles ddlLanguage.SelectedIndexChanged 

Page.UICulture = ddlLanguage.SelectedValue 

End Sub 


B. Protected Overrides Sub InitializeCulture() 

Page.UICulture = Request.Form("ddlLanguage") 

End Sub 


C. Protected Sub Page_Load(ByVal sender As Object, 

ByVal e As System.EventArgs) Handles Me.Load 

Page.Culture = Request.Form("ddlLanguage") 

End Sub 


D. Protected Overrides Sub InitializeCulture() 

Page.Culture = ddlLanguage.SelectedValue 

End Sub 


Answer: B 


Q130. You are implementing an ASP.NET Web page The page includes several controls, but only a GridView requires view state. You set the GridView… 

You need to ensure that the page will omit unneeded view state. 

Wich @ Page directive should you use? 

A. <% Page EnableViewState=”true” ViewStateMode=”Enabled” _ %> 

B. <% Page EnableViewState=”true” ViewStateMode=”Disabled” _ %> 

C. <% Page EnableViewState=”false” ViewStateMode=”Disabled” _ %> 

D. <% Page EnableViewState=”false” ViewStateMode=”Enabled” _ %> 

Answer: B 


70-515 brain dumps

Exact 70-515 samples:

Q131. You are developing an ASP.NET web page that includes a textbox control that has ID txtDate. 

You need to ensure that the user enters a valid date in the text box. 

Which markup should you use? 

A. <asp:CompareValidator ID="valDate" runat="server" Type="Date" ControlToCompare="txtDate" Operator="Equal"/> 

B. <asp:CompareValidator ID="valDate" runat="server" Type="Date" ControlToCompare="txtDate" Operator="DataTypeCheck"/> C. <asp:CompareValidator ID="valDate" runat="server" Type="Date" ControlToValidate="txtDate" Operator="DataTypeCheck"/> 

D. <asp:CompareValidator ID="valDate" runat="server" Type="Date" ControlToValidate="txtDate" Operator="Equal"/> 

Answer: C 


Q132. You are developing an ASP.NET Web page that includes a text box control. 

The page includes a server-side method named ValidateValue. 

You need to configure the page so that the text box value is validated by using the ValidateValue method. 

Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) 

A. Use the CompareValidator control. 

B. Use the CustomValidator control. 

C. Set ValidationGroup on the control to ValidateValue 

D. Set OnServerValidate on the control to ValidateValue. 

Answer: BD 


Q133. You create a Web page that contains the following div. 

<div id="target"> 

</div> 

You have a JavaScript array named imageurls that contains a list of image URLs. 

You need to write a JavaScript function that will insert images from the URLs into target. 

Which code segment should you use? 

A. $( imageurls ).each(function( i,url ){ 

$("< img />", url ).append("#target"); 

}); 


B. $( imageurls ).each(function( i,url ){ 

$("#target") += $("< img />"). attr (" src ", url ); 

}); 


C. $.each( imageurls , function( i,url ){ 

$("< img />"). attr (" src ", url ). appendTo ("#target"); 

}); 


D. $.each( imageurls , function( i,url ){ 

$("#target").append("< img />"). src = url ; 

}); 


Answer: C 


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


Q135. You are developing an ASP.Net web application. 

The application includes a master page named CustomerMaster.master that contains a public string property name EmployeeName application also includes a second master page named NestedMaster.master that is defined by the following directive. 

<%@ Master Language="C#" 

MasterPageFile="~/CustomMaster.Master" 

CodeBehind="NestedMaster.Master.cs" 

Inherits="MyApp.NestedMaster"%> 

You add a content page that uses the NestedMaster.master page file.The content page contains a label control named lblEmployeeName. 

You need to acces the EmployeeName value and display the value within the lblEmployeeName label. 

What should you do? 

A. Add the following code segment to the code-behind file of the content page. 

public void Page_load(object s, EventArgs e) 

lblEmployeeName.text= 

((MyApp.CustomMaster)Page.Master.Parent).EmployeeName; 


B. Add the following directive to the content page. 

<%@ MasterTypeVirtualPAth="~/CustomMaster.master" %> 


Add the following code segment to the code-behind file of the content page. 

public void Page_load(object s, EventArgs e) 

lblEmployeeName.text=this.Master.EmployeeName; 


C. Add the following code segment to the code-behind file of the content page. 

public void Page_load(object s, EventArgs e) 

lblEmployeeName.text= 

((MyApp.CustomerMaster)Page.Master.Master).EmployeeName; 


D. Add the following code segment to the code-behind file of the content page. 

public void Page_load(object s, EventArgs e) 

lblEmployeeName.text= 

((MyApp.CustomerMaster)Page.Master.Master) 

.FindControl("EmployeeName").toString(); 

Answer: C



see more TS: Web Applications Development with Microsoft .NET Framework 4