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 221:

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

    Function Edit(ByVal id As Integer) As ActionResult Return View(SelectUserToEdit(id)) End Function

    Function Edit(ByVal person As Person) As ActionResult

    UpdateUser(person)

    Return RedirectToAction("Index")

    End Function

    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.
    B. Add the following attribute to the first Edit action.
    C. Add the following attribute to the second Edit action.
    D. Add the following attribute to the second Edit action.

  • Question 222:

    You are implementing an ASP.NET MVC 2 Web application that contains several folders.

    The Views/Shared/DisplayTemplates folder contains a templated helper named Score.ascx that performs custom formatting of integer values.

    The Models folder contains a class named Player with the following definition.

    Public Class Player

    Public Property Name As String Public Property LastScore As Integer Public Property HighScore As Integer

    End Class

    You need to ensure that the custom formatting is applied to LastScore values when the HtmlHelper.DisplayForModel method is called for any view in the application that has a model of type Player. What should you do?

    A. Rename Score.ascx to LastScore.ascx.
    B. Move Score.ascx from the Views/Shared/DisplayTemplates folder to the Views/Player/ DisplayTemplates folder.
    C. Add the following attribute to the LastScore property.
    D. Add the following attribute to the LastScore property.

  • Question 223:

    You are developing an ASP.NET Web page that contains input controls, validation controls, and a button named btnSubmit.

    The page has the following code-behind. (Line numbers are included for reference only.) 01 Public Class _Default 02 Inherits System.Web.UI.Page 04 Protected Sub SaveToDatabase() 06 End Sub 08 Protected Sub btnSubmit_Click(ByVal sender As Object, 09 ByVal e As EventArgs) Handles btnSubmit.Click 11 End Sub 13 End Class

    You need to ensure that all data that is submitted passes validation before the data is saved in a database. What should you do?

    A. Add the following method override.Protected Overrides Sub OnInit(ByVal e As EventArgs) MyBase.OnInit(e)If (Page.IsValid) Then Me.SaveToDatabase() End Sub
    B. Add the following method override. Protected Overrides Sub OnLoad(ByVal e As EventArgs) MyBase.OnLoad(e)If (Page.IsValid) Then Me.SaveToDatabase()End Sub
    C. Add the following method override. Protected Overrides Sub OnPreRender(ByVal e As EventArgs) MyBase.OnPreRender(e)If (Page.IsValid) Then Me.SaveToDatabase()End Sub
    D. Add the following code segment at line 10.If (Page.IsValid) Then Me.SaveToDatabase()

  • Question 224:

    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.Use the following markup for the buttons in the ASP.NET page.HelpDetail
    B. Add the following markup to the default.skin file.Use the following markup for the buttons in the ASP.NET page.HelpDetail
    C. Add the following code segment to default.skin.Use the following markup for the buttons in the ASP.NET page.Detail
    D. Add the following markup to default.skin.Use the following markup for the buttons in the ASP.NET page.HelpDetail

  • Question 225:

    You are implementing an ASP.NET MVC 2 Web application that contains the following class.

    public class DepartmentController : Controller

    {

    static List departments =

    new List();

    public ActionResult Index()

    {

    return View(departments);

    }

    public ActionResult Details(int id)

    {

    return View(departments.Find(x => x.ID==id));

    }

    public ActionResult ListEmployees(Department d)

    {

    List employees = GetEmployees(d);

    return View(employees);

    }

    }

    You create a strongly typed view that displays details for a Department instance. You want the view to also include a listing of department employees.

    You need to write a code segment that will call the ListEmployees action method and output the results in place.

    Which code segment should you use?

  • Question 226:

    You are developing an ASP.NET Web page. The page includes a List instance. You add a FormView control to display a single Product from this list. You need to bind the list to the FormView control. Which FormView property should you set in the code-behind file?

    A. DataSource
    B. DataSourceID
    C. DataKeyNames
    D. DataMember

  • Question 227:

    You are developing as ASP.NET Web application that will display a list of values. The application must display the values in a tabular format in columns from top to bottom. You need to choose a control that can be bound directly to the list to

    render this display.

    Which control should you use?

    A. Datagrid
    B. Datalist
    C. GridView
    D. DataPager

  • Question 228:

    You are developing an ASP.NET Web page.

    You add the following markup to the page.

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

    01 Protected Sub btnUpload_Click(ByVal sender As Object, 02 ByVal e As EventArgs) Handles btnUpload.Click

    03 If () Then

    04 Dim saveName As String =

    05 Path.Combine("c:\uploadedfiles\",

    06 FileUpload1.FileName)

    08 lblFeedback.Text = "File successfully uploaded."

    09 Else

    10 lblFeedback.Text = "File upload failed."

    11 End If

    13 End Sub

    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) Then
    B. Replace line 03 with the following code segment. If (FileUpload1.FileContent.Length > 0) Then
    C. Insert the following code segment at line 07. FileUpload1.SaveAs(saveName)
    D. Insert the following code segment at line 07. FileUpload1.FileContent.CopyTo(New FileStream (saveName, FileMode.Open))

  • Question 229:

    You are developing an ASP.NET Web service.

    The following code segment implements the service. (Line numbers are included for reference only.)

    01

    ConformsTo:=WsiProfiles.BasicProfile1_1)>

    02 Public Class ProductService

    03 Inherits System.Web.Services.WebService

    05

    06 Public Function GetProduct(

    07 ByVal name As String) As Product

    09 End Function

    11

    12 Public Function GetProduct(

    13 ByVal id As Integer) As Product

    15 End Function

    17 End Class

    You need to ensure that both GetProduct methods can be called from a Web client. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

    A. Remove line 01.
    B. Add the Shared modifier on lines 06 and 12.
    C. Add the following attribute before line 11.
    D. Modify the attribute on line 11 as follows.

  • Question 230:

    ASP.net MVC dotn display a column Using LINQ to SQL class [MetadataType(typeof(ProductMetadata))] public pertial class Product { ... } public class ProductMetadata { ... }

    A. Add the following attribute to Product class[DisplayColumn("DiscontinueDate","DiscontinueDate",false)
    B. Add the following attribute to ProductMetadata class[DisplayColumn("DiscontinueDate","DiscontinueDate",false)
    C. Add the following code segment Product classpublic bool ScaffoldDisable(){return false;}
    D. ProductMetaData class[ScaffoldColumn(false)]public object DiscontinueDate;

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.