[Highest Quality] 70-515 Microsoft exam prep 181-195 (Mar 2016)

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:

Q181. You create a new ASP.NET MVC 2 Web application. The following default routes are created in the Global.asax.cs file. (Line numbers are included for reference only.) 

01 public static void RegisterRoutes(RouteCollection routes) 

02 { 

03 routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 


05 routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" } ); 

06 } 

You implement a controller named HomeController that includes methods with the following signatures. 

public ActionResult About() 

public ActionResult Index() 

public ActionResult Details(int id) 

You need to ensure that the About action is invoked when the root URL of the site is accessed. 

What should you do? 

A. At line 04 in the Global.asax.cs file, add the following line of code. routes.MapRoute("Default4Empty", "/", new {controller = "Home", action = "About"}); 

B. At line 04 in the Global.asax.cs file, add the following line of code. routes.MapRoute("Default", "", new {controller = "Home", action = "About"}); 

C. Replace line 05 in the Global.asax.cs file with the following line of code. routes.MapRoute("Default4Empty", "{controller}/{action}/{id}", new {controller = "Home", action = "About", id = ""}); 

D. Replace line 05 in the Global.asax.cs file with the following line of code. routes.MapRoute("Default", "{controller}/{action}", new {controller = "Home", action = "About"}); 

Answer: C 


Q182. Which property of the Label control gets\sets the identifer for a server control that the Label control is associated with? 

A. ClientID 

B. ID 

C. AssociatedControlID 

D. ControlID 

Answer: C 


Q183. You are implementing an ASP.NET page. 

You add asp:Button controls for Help and for Detail. 

You add an ASP.NET skin file named default.skin to a theme. 

You need to create and use a separate style for the Help button, and you must use the default style for the Detail button. What should you do? 

A. Add the following markup to the default.skin file. 

<asp:Button ID="Help"></asp:Button> 

<asp:Button ID="Default"></asp:Button> 

Use the following markup for the buttons in the ASP.NET page. 

<asp:Button SkinID="Help">Help</asp:Button> 

<asp:Button SkinID="Default">Detail</asp:Button> 


B. Add the following markup to the default.skin file. 

<asp:Button SkinID="Help"></asp:Button> 

<asp:Button ID="Default"></asp:Button> 

Use the following markup for the buttons in the ASP.NET page. 

<asp:Button SkinID="Help">Help</asp:Button> 

<asp:Button SkinID="Default">Detail</asp:Button> 


C. Add the following code segment to default.skin. 

<asp:Button SkinID="Help"></asp:Button> 

<asp:Button></asp:Button> 

Use the following markup for the buttons in the ASP.NET page. 

<asp:Button SkinID="Help"></asp:Button> 

<asp:Button SkinID="Default">Detail</asp:Button> 


D. Add the following markup to default.skin. 

<asp:Button SkinID="Help"></asp:Button> 

<asp:Button></asp:Button> 

Use the following markup for the buttons in the ASP.NET page. 

<asp:Button SkinID="Help">Help</asp:Button> 

<asp:Button>Detail</asp:Button> 


Answer: D 


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


Q185. You are implementing an ASP.NET Web site that uses a custom server control named Task. Task is defined as shown in the following list. 

.

Class name: Task 

Namespace: DevControls 

Assembly: TestServerControl.dll 

Base class: System.Web.UI.WebControls.WebControl 

You copy TestServerControl.dll to the Web sites Bin folder. 

You need to allow the Task control to be declaratively used on site pages that do not contain an explicit @ Register directive. 

Which configuration should you add to the web.config file? 

A. <appSettings> 

<add key="Dev:Task" 

value="DevControls, DevControls.Task"/> 

</appSettings> 


B. <compilation targetFramework="4.0" explicit="false"> 

<assemblies> 

<add assembly="TestServerControl" /> 


</assemblies> </compilation> 

C. <pages> 

<controls> 

<add assembly="TestServerControl" namespace="DevControls" 

tagPrefix="Dev"/> 

</controls> 

</pages> 


D. <pages> 

<tagMapping> 

<add tagType="System.Web.UI.WebControls.WebControl" 

mappedTagType="DevControls.Task"/> 

</tagMapping> 

</pages> 


Answer: C 


70-515 braindumps

Down to date 70-515 exam question:

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

public partial class CustomMaster : MasterPage 

public string Region 

get; set; 

protected void Page_Load(object sender, EventArgs e) 

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. 

CustomMaster custom = this.Parent as CustomMaster; 

lblRegion.Text = custom.Region; 


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

CustomMaster custom = this.Master as CustomMaster; 


lblRegion.Text = custom.Region; 

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

code-behind file. 

Label lblRegion = Page.FindControl("lblRegion") as Label; 

lblRegion.Text = this.Region; 


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

code-behind file. 

Label lblRegion = Master.FindControl("lblRegion") as Label; 

lblRegion.Text = this.Region; 


Answer: B 


Q187. Which property of the ListView class is used to get\set the name of the data field whose value exclusively identifes every data row of a ListView when the ClientIDMode property is set to Predictable? 

A. LoadViewStateByID 

B. UniqueID 

C. ClientIDMode 

D. ClientIDRowSuffix 

Answer: D 


Q188. Gridview: How to change the image of an image control place in each row in a gridview: 

A. ItemDataBound 

B. Init 

C. Prerender 

D. <something I don’t remember> 

Answer: A 


Q189. You are developing an ASP.NET Web page. You add the following markup to the page. 

<asp:FileUpload id="FileUpload1" runat="server" /> <asp:Button id="btnUpload" Text="Upload selected file" OnClick="btnUpload_Click" runat="server" /> <asp:Label id="lblFeedback" runat="server" /> 

You add the following code segment to the code-behind. (Line numbers are included for reference only.) 

01 protected void btnUpload_Click(object sender, 

EventArgs e) 02 { 03 if () 04 { 05 string saveName = Path.Combine(@"c:\uploadedfiles\", 

FileUpload1.FileName); 

07 lblFeedback.Text = "File successfully uploaded."; 08 } 09 else 

10 { 

11 lblFeedback.Text = "File upload failed."; 

12 } 

13 } 

You need to save the uploaded file and display a message to the user that indicates that the upload either succeeded or failed. 

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

A. Replace line 03 with the following code segment. if (FileUpload1.HasFile) 

B. Replace line 03 with the following code segment. if (FileUpload1.FileContent.Length > 0) 

C. Insert the following code segment at line 06. FileUpload1.SaveAs(saveName); 

D. Insert the following code segment at line 06. FileUpload1.FileContent.CopyTo(new FileStream(saveName, FileMode.Open)); 

Answer: AC 


Q190. You are implementing an ASP.NET Web site. The Web site contains a Web service named CustomerService. 

The code-behind file for the CustomerService class contains the following code segment. 

public class ProductService : System.Web.Services.WebService 

public List<Product> GetProducts(int categoryID) 

return GetProductsFromDatabase(categoryID); 

You need to ensure that the GetProducts method can be called by using AJAX. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) 

A. Apply the WebService attribute to the ProductService class. 

B. Apply the ScriptService attribute to the ProductService class. 

C. Apply the WebMethod attribute to the GetProducts method. 

D. Apply the ScriptMethod attribute to the GetProducts method. 

Answer: BC 


70-515 free practice questions

Real 70-515 exam topics:

Q191. A Web page includes the HTML shown in the following code segment. 


<span id="ref"> 

<a name=Reference>Check out</a> 

the FAQ on 

<a href="http://www.contoso.com"> 

Contoso</a>'s web site for more information: 

<a href="http://www.contoso.com/faq"> FAQ </a>. 

</span> 

<a href="http://www.contoso.com/ home "> Home </a> 


You need to write a JavaScript function that will dynamically format in boldface all of the hyperlinks in the ref span. 

Which code segment should you use? 

A. $("#ref").filter("a[href]").bold(); 

B. $("ref").filter("a").css("bold"); 

C. $("a").css({fontWeight:"bold"}); 

D. $("#ref a[href]").css({fontWeight:"bold"}); 

Answer: D 


Q192. You are developing an ASP.NET Web page. 

The page uses the MicrosoftAjax.js script file and the MicrosoftAjaxWebForms.js script file. 

You need to ensure that both scripts are combined into a single script. 

Which markup should you use? 


A. <asp:ScriptManager ID="sm1" runat="server"> 

<CompositeScript> 

<Scripts> 

<asp:ScriptReference Name="MicrosoftAjax.js" /> 

<asp:ScriptReference Name="MicrosoftAjaxWebForms.js" /> 

</Scripts> 

</CompositeScript> 

</asp:ScriptManager> 


B. <asp:ScriptManager ID="sm1" runat="server"> 

<CompositeScript ScriptMode="Auto"> 

<Scripts> 

<asp:ScriptReference Name="MicrosoftAjax.js" /> 

<asp:ScriptReference Name="MicrosoftAjaxWebForms.js" /> 

</Scripts> 

</CompositeScript> 

</asp:ScriptManager> 


C. <asp:ScriptManager ID="sm1" runat="server"> 

<CompositeScript ScriptMode="Release"> 

<Scripts> 

<asp:ScriptReference Name="MicrosoftAjax.js" /> 

<asp:ScriptReference Name="MicrosoftAjaxWebForms.js" /> 

</Scripts> 

</CompositeScript> 

</asp:ScriptManager> 


D. <asp:ScriptManager ID="sm1" runat="server"> 

<Scripts> 

<asp:ScriptReference Name="MicrosoftAjax.js" /> 

<asp:ScriptReference Name="MicrosoftAjaxWebForms.js" /> 

</Scripts> 

</asp:ScriptManager> 


Answer: A 


Q193. You have a login.ascx control and to display it in a view which method u would use.. 

A. http.display 

B. http.partial 

C. http.load 

D. http.get 

Answer: B 


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


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