Top 15 practice exam 70-515 for IT professionals (106 to 120)

70-515 Royal Pack Testengine pdf

100% Actual & Verified — 100% PASS

Unlimited access to the world's largest Dumps library! Try it Free Today!

https://www.exambible.com/70-515-exam/

Product Description:
Exam Number/Code: 70-515
Exam name: TS: Web Applications Development with Microsoft .NET Framework 4
n questions with full explanations
Certification: Microsoft Certification
Last updated on Global synchronizing

Free Certification Real IT 70-515 Exam pdf Collection

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 Mar 70-515 Study Guide Questions:

Q106. You create an ASP.NET server control in the SampleControl namespace. 

The control uses a JavaScript file names Refresh.js to implement AJAX functionality. 

You need to ensre that the JavaScript file is included in the assembly. 

Which two actions should you perform (Choose 2) 

A. Add the following assembly attribute to the AssemblyInfo file. [assembly: WebResource("SampleControl.Refresh.js", "application/x-javascript")] 

B. 

Add the following assembly attribute to the AssemblyInfo file. [assembly:ScriptResource("SampleControl.Refresh.js")] 

C. In the Properties window for the Refresh.js file, set the Build Action to Embedded Resource. 

D. In the Properties window for the Refresh.js file, set the Build Action to Content. 

Answer: AC 


Q107. You are creating an ASP.NET Web site. The site is configured to use Membership and Role management providers. You need to check whether the currently logged-on user is a member of a role named Administrators. Which code segment should you use? 

A. bool isMember = Roles.GetUsersInRole("Administrators").Any(); 

B. bool isMember = Membership.ValidateUser(User.Identity.Name, "Administrators"); 

C. bool isMember = Roles.GetRolesForUser("Administrators").Any(); 

D. bool isMember = User.IsInRole("Administrators"); 

Answer: D 


Q108. You are implementing an ASP.NET application. You add the following code segment. 


You need to add code to return a list of all Person objects except those with a UserId that is contained in the secretUsers list. The resulting list must not contain duplicates. 

Which code segment should you use? 

A. var secretPeople = (from p in allPeople from u in secretUsers where p.UserId == u select p).Distinct(); return allPeople.Except(secretPeople); 

B. return from p in allPeople 

from u in secretUsers 

where p.UserId != u 

select p; 


C. return (from p in allPeople 

from u in secretUsers 

where p.UserId != u 

select p).Distinct(); 


D. List<Person> people = new List<Person>( 

from p in allPeople 

from u in secretUsers 

where p.UserId != u 

select p); 

return people.Distinct(); 


Answer: A 


Q109. You create an ASP.NET page. The page uses the jQuery $.ajax function to make calls back to the server in several places. 

You add the following div element to the page. 

<div id="errorInfo"> </div> 

You need to implement a single error handler that will add error information from all page $.ajax calls to the div named errorInfo. 

What should you do? 

A. Add the following options to each $.ajax function call: 

global: true, 

error: function (XMLHttpRequest, textStatus, errorThrown){ $("#errorInfo").text("<li>Error 

information is: " + textStatus + "</li>"); 


B. Add the following code to the $(document).ready function on the page: 

$("#errorInfo").ajaxError(function(event, request, settings){ $(this).append("<li>Error 

requesting page " + settings.url + "</li>"); }); 


C. Add the following option to each $.ajax function call: 

error: function (XMLHttpRequest, textStatus, errorThrown){ $("#errorInfo").text("<li>Error 

information is: " + textStatus + "</li>"); 


D. Add the following code to the $(document).ready function on the page: 

$.ajaxError(function(event, request, settings){ 

$(this).append("<li>Error requesting page " + settings.url + "</li>");}); 

Add the following option to each $.ajax function call: 

global: true 


Answer: B 


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

<asp:PlaceHolder ID="dynamicControls" runat="server"> <asp:DropDownList ID="MyDropDown" runat="server"> <asp:ListItem Text="abc" value="abc" /> 

<asp:ListItem Text="def" value="def" /> 

</asp:DropDownList> 

</asp:PlaceHolder> 

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 

Private Sub mydropdown_PreRender(ByVal sender As Object, ByVal e As System. 

EventArgs) Handles mydropdown.PreRender 

Dim ddl As DropDownList = TryCast(sender, DropDownList) 

Dim lbl As Label = New Label() 

lbl.Text = "Option" 

lbl.ID = "Option" 

ddl.Controls.Add(lbl) 

End Sub 


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

Private Sub mydropdown_PreRender(ByVal sender As Object, ByVal e As System. 

EventArgs) Handles mydropdown.PreRender 

Dim ddl As DropDownList = TryCast(sender, DropDownList) 

ddl.Items.Add("Option") 

End Sub 


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

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) 

Handles Me.Load 

Dim ddl As DropDownList = TryCast(Page.FindControl("mydropdown"), 

DropDownList) 

Dim lbl As Label = New Label() 

lbl.Text = "Option" 

lbl.ID = "Option" 

ddl.Controls.Add(lbl) 

End Sub 


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

Private Sub Page_LoadComplete(ByVal sender As Object, ByVal e As System. 

EventArgs) Handles Me.LoadComplete 

TryCast(Page.FindControl("mydropdown"), DropDownList) 

ddl.Items.Add("Option") 

End Sub 


Answer: B 


70-515 brain dumps

Leading 70-515 rapidshare:

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


Q112. You are implementing a Web page that allows users to upload files to a Web server. The page includes a form that has a Submit button. You need to reject files larger than 1 MB. What should you do? 

A. Add an HTML input type= file control. Add an onSubmit handler to the form to check the file size and cancel the form submission if the file size is too large. 

B. Add an HTML input type= file control. Add an onChange handler to the input control to check the file size and cancel the upload if the file size is too large. 

C. Add an ASP.NET FileUpload control and configure it to run on the server. Add a server-side OnClick handler to the form's Submit button to save the file only if the file size is allowed. 

D. Add an ASP.NET FileUpload control and configure it to run on the server. Add a server-side OnDataBinding handler that saves the file only if the file size is allowed. 

Answer: C 


Q113. You create a Web page that contains drop-down menus that are defined by using div tags in the following code. 


You need to write a JavaScript function that will enable the drop-down menus to activate when the user positions the mouse over the menu title. 

Which code segment should you use? 

A. $(".dropdown-menu").hover( 

function () { 

$(".menu-items"). slideDown (100); 

}, 

function () { 

$(".menu-items"). slideUp (100); 

); 


B. $(".dropdown-menu").hover( 

function () { 

$(".menu-items", this). slideDown (100); 

}, 

function () { 

$(".menu-items", this). slideUp (100); 

); 


C. $(".dropdown-menu").hover( 

function () { 

$(this). slideDown (100); 

}, 

function () { 

$(this). slideUp (100); 

); 


D. $(".dropdown-menu").hover( 

function () { 

$(this, ".menu-title"). slideDown (100); 

}, 

function () { 

$(this, ".menu-title"). slideUp (100); 

); 

Answer: B 


Q114. You are implementing an ASP.NET application that will use session state in out-of-proc mode. You add the following code. 

Public Class Person 

Public Property FirstName As String 

Public Property LastName As String 

End Class 

You need to add an attribute to the Person class to ensure that you can save an instance to session state. Which attribute should you use? 

A. Bindable 

B. Serializable 

C. DataContract 

D. DataObject 

Answer: B 


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


70-515 exam question

Printable 70-515 braindumps:

Q116. You are creating an ASP.NET Web site. The site has a master page named Custom.master. The code-behind file for Custom.master contains the following code segment. 

Partial Public Class Custom Inherits System.Web.UI.MasterPage 

Public Property Region As String 

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 

End Sub 

End Class 

You create a new ASP.NET page and specify Custom.master as its master page. 

You add a Label control named lblRegion to the new page. 

You need to display the value of the master page's Region property in lblRegion. 

What should you do? 

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

Dim custom As Custom = Me.Parent 

lblRegion.Text = custom.Region 


B. Add the following code segment to the Page_Load method of the page code-behind file. 

Dim custom As Custom = Me.Master 

lblRegion.Text = custom.Region 


C. Add the following code segment to the Page_Load method of the Custom.Master.vb 

code-behind file. 

Dim lblRegion As Label = Page.FindControl("lblRegion") 

lblRegion.Text = Me.Region 


D. Add the following code segment to the Page_Load method of the Custom.Master.vb 

code-behind file. 

Dim lblRegion As Label = Master.FindControl("lblRegion") 

lblRegion.Text = Me.Region 


Answer: B 


Q117. You create an ASP.NET MVC 2 Web application that contains the following controller class. 

public class ProductController : Controller 

static List<Product> products = new List<Product>(); 

public ActionResult Index() 

return View(); 

}} 

In the Views folder of your application, you add a view page named Index.aspx that includes the following @ Page directive. 

<%@ Page Inherits="System.Web.Mvc.ViewPage" %> 

You test the application with a browser. You receive the following error message when the Index method is invoked: "The view 'Index' or its master was not found." 

You need to resolve the error so that the new view is displayed when the Index method is invoked. 

What should you do? 

A. Change the name of the Index.aspx file to Product.aspx. 

B. Create a folder named Product inside the Views folder. Move Index.aspx to the Product folder. 

C. Replace the @ Page directive in Index.aspx with the following value. <%@ Page Inherits="System.Web.Mvc.ViewPage<Product>" %> 

D. Modify the Index method by changing its signature to the following: public ActionResult Index(Product p) 

Answer: B 


Q118. You are developing an ASP.NET web page. The page includes functionality to make a web request and to display the responde in a specified HTML element. 

You need to add a client-side function to write the response to the specified HTML element.Which function should you add? 

A. function loadData(url,element){ 

$(element).ajaxStart(function(){ 

$(this).text(url); 

}); 


B. function loadData(url,element){ 

$(element).ajaxSend(function(){ 

$(this).text(url); 

}); 


C. function loadData(url,element){ 

$.post(element,function(url){ 

$(element).text(url); 

}); 


D. function loadData(url,element){ 


$.get(url,function(data){ 

$(element).text(data); 

}); 


Answer: D 


Q119. You are developing an ASP.NET Web application. You create a master page. The master page requires a region where you can add page-specific content by using the ASP.NET page designer. You need to add a control to the master page to define the region. 

Which control should you add? 

A. Content 

B. ContentPlaceHolder 

C. PlaceHolder 

D. Substitution 

Answer: B 


Q120. You need to dynamically add TestUserControl.ascx to TestPage.aspx. 

Which code segment should you use? 

A. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) 

Handles Me.Load 

Dim userControl As Control = Page.LoadControl("TestUserControl.ascx") 

Page.Form.Controls.Add(userControl) 

End Sub 


B. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) 


Handles Me.Load 

Dim userControl As Control = Page.FindControl("TestUserControl.ascx") 

Page.Form.Controls.Add(userControl) 

End Sub 


C. Private Sub TestPage_Init(ByVal sender As Object, ByVal e As System.EventArgs) 

Handles Me.Init 

Dim userControl As Control = Page.LoadControl("TestUserControl.ascx") 

Page.Form.Controls.Add(userControl) 

End Sub 


D. Private Sub TestPage_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) 

Handles Me.PreInit 

Dim userControl As Control = 

Page.FindControl("TestUserControl.ascx"Page.Form.Controls.Add(userControl) End Sub 


Answer: C