70-515 Exam Details

  • Exam Code
    :70-515
  • Exam Name
    :TS: Web Applications Development with Microsoft .NET Framework 4
  • Certification
    :Microsoft Certifications
  • Vendor
    :Microsoft
  • Total Questions
    :285 Q&As
  • Last Updated
    :Jan 26, 2022

Microsoft 70-515 Online Questions & Answers

  • Question 31:

    You are developing an ASP.NET Web page.

    The page contains the following markup.

    onrowdatabound="gvModels_RowDataBound"

    AutoGenerateColumns="false">

    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)

    08 img.ImageUrl =

    09 String.Format("images/{0}.jpg", cm.ID)

    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)

  • Question 32:

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

    Check out

    the FAQ on

    Contoso's web site for more information:

    FAQ .

    Home

    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"});

  • Question 33:

    You work as an ASP.NET Web Application Developer for SomeCompany. The company uses Visual Studio .NET 2010 as its application development platform. You create an ASP.NET MVC 2 Web application using .NET Framework 4.0.

    You implement a single project area in the MVC 2 Web application. In the Areas folder, you add a subfolder named MyTest. You add the following files to the appropriate sub-folders:

    MyController. cs

    MyHome.aspx

    You register a route of the area, setting the route name to MyTest_default and the area name to test. You create a view named MyViews.aspx that is outside the test area. You need to add a link to MyViews.aspx that points to MyHome.aspx.

    Which of the following code segments will you use?

  • Question 34:

    You are developing an ASP.NET application by using Visual Studio 2010. You need to interactively debug the entire application. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

    A. Set the Debug attribute of the compilation node of the web.config file to true.
    B. Add a DebuggerDisplay attribute to the code-behind file of the page that you want to debug.
    C. Select the ASP.NET debugger option in the project properties.
    D. Define the DEBUG constant in the project settings.

  • Question 35:

    You are implementing an ASP.NET MVC 2 Web application. You create a shared user control named MenuBar.ascx that contains the application's menu. You need to use the menu bar in all application views. What should you do?

    A. In the site's master page, create a div element with an ID of Navigation.Add the following code segment inside this div element.
    B. In the site's master page, create a div element with an ID of Navigation.Add the following code segment inside this div element.
    C. In each of the controller's action methods, add an entry to the ViewData collection with a key of Navigation and a value of ~/Views/Shared/MenuBar.ascx.
    D. In the site's Global.asax.cs file, register a route named Navigation that points to the ~/Views/Shared/ MenuBar.ascx file.

  • Question 36:

    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.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("EmployeeNam e").toString();}

  • Question 37:

    You are implementing an ASP.NET AJAX page. You add two UpdatePanel controls named pnlA and pnlB. pnlA contains an UpdatePanel control named pnlAInner in its content template. You have the following requirements.

    You need to configure the panels to meet the requirements. What should you do?

    A. Set the UpdateMode of pnlA and pnlB to Conditional. Set the UpdateMode of pnlAInner to Always.
    B. Set the UpdateMode of pnlA and pnlB to Conditional. Set the UpdateMode of pnlAInner to Conditional, and add AsyncPostBackTrigger elements to its Triggers element for every control in pnlA.
    C. Set the UpdateMode of pnlA and pnlB to Always. Set the UpdateMode of pnlAInner to Conditional.
    D. Set the UpdateMode of pnlA and pnlB to Always. Set the UpdateMode of pnlAInner to Always, and add AsyncPostBackTrigger elements to its Triggers element for every control in pnlB.

  • Question 38:

    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");

  • Question 39:

    You are implementing a method in an ASP.NET application that includes the following requirements. Store the number of active bugs in the cache. The value should remain in the cache when there are calls more often than every 15 seconds. The value should be removed from the cache after 60 seconds. You need to add code to meet the requirements. Which code segment should you add?

    A. Cache.Insert("ActiveBugs", result, null, DateTime.Now.AddSeconds(60), TimeSpan.FromSeconds(15));
    B. Cache.Insert("Trigger", DateTime.Now, null, DateTime.Now.AddSeconds(60), Cache.NoSlidingExpiration);CacheDependency cd = new CacheDependency(null, new string[] { "Trigger" });Cache.Insert("ActiveBugs", result, cd, Cache.NoAbsoluteExpiration, TimeSpan.FromSeconds(15));
    C. Cache.Insert("ActiveBugs", result, null, Cache.NoAbsoluteExpiration, TimeSpan.FromSeconds(15));CacheDependency cd = new CacheDependency(null, new string[] { "ActiveBugs" });Cache.Insert("Trigger", DateTime.Now, cd, DateTime.Now.AddSeconds(60), Cache.NoSlidingExpiration);
    D. CacheDependency cd = new CacheDependency(null, new string[] { "Trigger" });Cache.Insert("Trigger", DateTime.Now, null, DateTime.Now.AddSeconds(60), Cache.NoSlidingExpiration);Cache.Insert("ActiveBugs", result, cd, Cache.NoAbsoluteExpiration, TimeSpan.FromSeconds(15));

  • Question 40:

    You are creating an ASP.NET web page that contains several FileUpload controls. The page will be posted to the server after one or more image files are selected for upload. You need to ensure that all uploaded files are saved to the server

    within one call to a single event handler.

    What should you do?

    A. Read the HttpRequest.Files property and call the HttpPostedFile.SaveAs method for each file.
    B. Read the HttpRequest.inputStream property and call the System.Io.File.WriteLines method or each file.
    C. Read the HttpRequest.inputStream property and call the HttpResponse.WriteLine method for each file.
    D. Read the HttpRequest.Files property and call the System.Io.File.WriteLines method for each file.

Tips on How to Prepare for the Exams

Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Microsoft exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your 70-515 exam preparations and Microsoft certification application, do not hesitate to visit our Vcedump.com to find your solutions here.