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

Q166. You are developing an ASP.NET web application. 

The application includes a class library named Contoso.dll that will be used by other ASP.Net applications on the same server. 

You need to ensure that only one copy of the class library exists on the server. 

What should you do? 

A. Add the following code segment to the top of each web page. <%@ Register TagPrefix="cc" NameSpace="contoso" Assembly="contoso" %> 

B. Install the class library into the Global Assembly Cache on the server. 

C. Deploy the class library on the App_Code folder 

D. Add the following assembly attribute to the Contoso class library′s AssemblyInfo.cs file. [assembly: AssemblyConfiguration("Shared")] 

Answer: B 


Q167. You are implementing an ASP.NET MVC 2 Web application. A controller contains the following code. 

public ActionResult Edit(int id) 

return View(SelectUserToEdit(id)); 

public ActionResult Edit(Person person) 

UpdateUser(person); 

return RedirectToAction("Index"); 

The first Edit action displays the user whose details are to be edited, and the second Edit action is called when the Save button on the editing form is clicked to update the user details. An exception is thrown at run time stating that the request for action Edit is ambiguous. You need to correct this error and ensure that the controller functions as expected. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.) 

A. Add the following attribute to the first Edit action. [AcceptVerbs(HttpVerbs.Head)] 

B. Add the following attribute to the first Edit action. [HttpGet] 

C. Add the following attribute to the second Edit action. [HttpPost] 

D. Add the following attribute to the second Edit action. 

[HttpPut] 

Answer: B,C 


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


Q169. You use the ASP.NET Web Site template to create a Web site that will be deployed to multiple locations. Each location will specify its SMTP configuration settings in a separate file named smtp.config in the root folder of the Web site. 

You need to ensure that the configuration settings that are specified in the smtp.config file will be applied to the Web site. 

Which configuration should you use in web.config? 

A. <configuration> 

<system.net> 

<mailSettings> 

<smtp configSource="smtp.config" allowOverride="true"> 

<network host="127.0.0.1" port="25"/> 

</smtp> 

</mailSettings> 

</system.net> 

</configuration> 


B. <configuration> 

<system.net> 


<mailSettings> 

<smtp configSource="smtp.config" /> 

</mailSettings> 

</system.net> 

</configuration> 


C. <configuration xmlns:xdt="http://schemas.microsoft.com/XML- Document-Transform"> 

<location path="smtp.config" xdt:Transform="Replace" xdt:Locator="Match 

(path)"> 

<system.net /> 

</location> 

</configuration> 


D. <configuration> 

<location path="smtp.config"> 

<system.net> 

<mailSettings> 

<smtp Devilery Method="Network" > 

<Network Host = "127.0.0.1" Port="25"/> 

</smtp> 

</mailSettings> 

</system.net> 

</location> 

</configuration> 


Answer: B 


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

The application includes a Icomparer<string> implementation named CaseInsensitiveComparer that compares strings without case sensitivity You add the following method.(Line numbers are included for reference only.) 

01 public IEnumerable<string>SortWords(string[] words) 02 { 

04 } 

You need to sort the array by word length and then by alphabetic order, ignoring case. Which code segment should you add at line 03? 

A. return words.Orderby(a => a, new CaseInsensitiveComparer()).ThenBy(a =>a.Length); 

B. return words.Orderby(a =>a.Length).Orderby(a => a,new CaseInSensitiveComparer()); 

C. return words.Orderby(a =>a.Length).ThenBy(a=> a, new CaseInSensitiveComparer()); 

D. return words.Orderby(a =>a.Length.toString(), new CaseInSensitiveComparer()); 

Answer: C 


Q171. A Web service returns a list of system users in the following format. 

<?xml version="1.0" ?> 

<users> 

<user id="first"> 

<name>Name of first user</name> 

<email>first@contoso.com</email> 

</user> 

<user id="second"> 

<name>Name of second user</name> 

<email>second@contoso.com</email> 

</user> 

</users> 


You need to populate a drop-down menu with the IDs and names of the users from the Web service, in the order provided by the service. 

Which code segment should you use? 

A. $.ajax({ 

type: "GET", 

url: serviceURL, 

success: function(xml) { 

$.each($(xml), function(i, item) { 

$("<option>").attr("value", id) 

.text(tx).appendTo("#dropdown"); 

}); 

}); 


B. $.ajax({ 

type: "GET", 

url: serviceURL, 

success: function(xml) { 

$(xml).find("user").each(function() { 

var id = $(this).id; 

var tx = $(this).name.text; 

$("<option>").attr("value", id) 

.text(tx).appendTo("#dropdown"); 

}); 

}); 


C. $.ajax({ 

type: "GET", 

url: serviceURL, 

success: function(xml) { 

$(xml).find("user").each(function() { 

var id = $(this).attr("id"); 

var tx = $(this).find("name").text(); 

$("<option>").attr("value", id) 

.text(tx).appendTo("#dropdown"); 

}); 

}); 


D. $.ajax({ 

type: "GET", 

url: serviceURL, 

success: function(xml) { 

xml.find("user").each(function(node) { 

var id = $(node).attr("id"); 

var tx = $(node).find("name").text(); 

$("<option>").attr("value", id) 

.text(tx).appendTo("#dropdown"); 

}); 

}); 


Answer: C 


Q172. You are developing an ASP.NET Web application.The application is configured to use the membership and role providers. 

You need to allow all users to perform an HTTP GET for application resources, but you must allow only the user named Moderator to perform a POST operation.Which configuration should you add to the web.config file? 

A. <authorization> 

<deny verbs="GET" users="*"/> 

<allow verbs="POST" users="Moderator"/> 

<deny verbs="POST" users="*"/> 

</authorization> 


B. <authorization> 

<deny verbs="POST" users="*"/> 

<allow verbs="POST" users="Moderator"/> 

<allow verbs="GET" users="*"/> 

</authorization> 


C. <authorization> 

<allow verbs="GET" users="*"/> 

<allow verbs="POST" users="Moderator"/> 

<deny verbs="POST" users="*"/> 

</authorization> 


D. <authorization> 

<allow verbs="GET" users="*"/> 

<deny verbs="POST" users="Moderator"/> 


<deny verbs="POST" users="*"/> </authorization> 

Answer: C 


70-515  exam prep

Latest latest dumps for 70-515:

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


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


Q175. You are implementing an ASP.NET application that includes a page named TestPage.aspx. TestPage.aspx uses a master page named 

TestMaster.master. 

You add the following code to the TestPage.aspx code-behind file to read a TestMaster.master public property named CityName. 

Protected Sub Page_Load(ByVal sender As Object, 

ByVal e As System.EventArgs) Handles Me.Load 

Dim s As String = Master.CityName 

End Sub 

You need to ensure that TestPage.aspx can access the CityName property. What should you do? 

A. Add the following directive to TestPage.aspx. <%@ MasterType VirtualPath="~/TestMaster.master" %> 

B. Add the following directive to TestPage.aspx. <%@ PreviousPageType VirtualPath="~/TestMaster.master" %> 

C. Set the Strict attribute in the @ Master directive of the TestMaster.master page to true. 

D. Set the Explicit attribute in the @ Master directive of the TestMaster.master page to true. 

Answer: A 


Q176. You create a Web page named TestPage.aspx and a user control named TestUserControl.ascx. TestPage.aspx uses TestUserControl.ascx as shown in the following line of code. 

<uc:TestUserControl ID="testControl" runat="server"/> 

On TestUserControl.ascx, you need to add a read-only member named CityName to return the value "New York". You also must add code to TestPage.aspx to read this value. 

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

A. Add the following line of code to the TestUserControl.ascx.cs code-behind file. 

public string CityName { 

get { return "New York" ; } 


B. Add the following line of code to the TestUserControl.ascx.cs code-behind file. 

protected readonly string CityName = "New York" ; 


C. Add the following code segment to the TestPage.aspx.cs code-behind file. 

protected void Page_Load(object sender, EventArgs e) 

strings = testControl.CityName; 


D. Add the following code segment to the TestPage.aspx.cs code-behind file. 

protected void Page_Load(object sender, EventArgs e) 

string s = testControl.Attributes["CityName"]; 


Answer: AC 


Q177. Ajax extender [TargetControlType(typeof(TextBox))] 

public class DisabledButtonExtender : ExtenderControlBase 

[ExtenderControlProperty] 

[DefaultValue("")] 

[IDReferenceProperty(typeof(Button))] 

Create an extender that extends a textbox and assigns to a button; 

Using wich combination? 

A. [TargetControlType(typeof(TextBox))] [IDReferenceProperty(typeof(Button))] 

Answer: A 


Q178. You are implementing an ASP.NET application that includes the following requirements. Retrieve the number of active bugs from the cache, if the number is present. If the number is not found in the cache, call a method named GetActiveBugs, and save the result under the ActiveBugs cache key. Ensure that cached data expires after 30 seconds. You need to add code to fulfill the requirements. Which code segment should you add? 

A. int numOfActiveBugs = (int)Cache["ActiveBugs"]; 

if (!numOfActiveBugs.HasValue) 

int result = GetActiveBugs(); 

Cache.Insert("ActiveBugs", result, null, 

DateTime.Now.AddSeconds(30), Cache.NoSlidingExpiration); 

numOfActiveBugs = result; 

ActiveBugs = numOfActiveBugs.Value; 


B. int numOfActiveBugs = (int) Cache.Get("ActiveBugs"); 

if (numOfActiveBugs != 0) 

int result = GetActiveBugs(); 

Cache.Insert("ActiveBugs", result, null, 

DateTime.Now.AddSeconds(30), Cache.NoSlidingExpiration); 

numOfActiveBugs = result; 

ActiveBugs = numOfActiveBugs; 


C. int numOfActiveBugs = 0; 

if (Cache["ActiveBugs"] == null) 

int result = GetActiveBugs(); 

Cache.Add("ActiveBugs", result, null, DateTime.Now.AddSeconds(30), 

Cache.NoSlidingExpiration, 

CacheItemPriority.Normal, null); Cache.NoSlidingExpiration, CacheItemPriority.Normal, 


null); 

numOfActiveBugs = result; 

ActiveBugs = numOfActiveBugs; 


D. int numOfActiveBugs = (int?)Cache["ActiveBugs"]; 

if (!numOfActiveBugs.HasValue) 

int result = GetActiveBugs(); 

Cache.Insert("ActiveBugs", result, null, 

Cache.NoAbsoluteExpiration, TimeSpan.FromSeconds(30)); 

numOfActiveBugs = result; 

ActiveBugs = numOfActiveBugs.Value; 


Answer: A 


Q179. You create a Web page that contains the span shown in the following line of code. 

<span id="span1">Text</span> 

You need 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 


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

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

You are creating an ASP.NET Web application using .NET Framework 4.0. 

The application will provide information about products manufactured by the company. 

The company has a branch office in Saudi Arabia. 

The Sales department employees of the branch office in Saudi Arabia will use the 


application. 

You are required to accomplish the following tasks: 


The application displays contents in the correct format for the employees of the Saudi Arabia office. 

Each page in the application is displayed in the right-to-left format. 

What will you do to accomplish these tasks? 

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


A. In the Web.config file of the Web application, set the culture attribute of the <globalization> element to "ar-SA". 

B. In the Web.config file of the Web application, set the uiCulture attribute to "ar-SA". 

C. In the Web.config file of the Web application, set the culture attribute to "SA". 

D. In the Web.config file of the Web application, set the culture attribute of the <globalization> element to "ar". 

E. Set the HTML dir attribute for the <body> element of each page to "rfl". 

Answer: AE 



see more 70-515 dumps