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

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

  • Question 112:

    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.LoadDim 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.LoadDim 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.InitDim 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.PreInitDim userControl As Control =Page.FindControl("TestUserControl.ascx"Page.Form.Controls.Add(userControl) End Sub

  • Question 113:

    You are implementing an ASP.NET Web site. The site contains the following class. Public Class Address Public AddressType As Integer Public Line1 As String Public Line2 As String Public City As String Public ZipPostalCode As String End Class The Web site interacts with an external data service that requires Address instances to be given in the following XML format.

    250 Race Court Chicago 60603

    You need to ensure that Address instances that are serialized by the XmlSerializer class meet the XML format requirements of the external data service.

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

    A. Add the following attribute to the AddressType field.
    B. Add the following attribute to the Line2 field.
    C. Add the following attribute to the ZipPostalCode field.
    D. Add the following attribute to the ZipPostalCode field.

  • Question 114:

    You are creating an ASP.NET Web site. You create a HTTP module named CustomModule, and you register the module in the web.config file. The CustomModule class contains the following code.

    Public Class CustomModule Implements IHttpModule Dim footerContent As String = "

    Footer Content
    " Public Sub Dispose() Implements IHttpModule.Dispose End Sub End Class

    You need to add code to CustomModule to append the footer content to each processed ASP.NET page.

    Which code segment should you use?

    A. Public Sub New(ByVal app As HttpApplication)AddHandler app.EndRequest, AddressOf app_EndRequestEnd SubSub app_EndRequest(ByVal sender As Object, ByVal e As EventArgs)Dim app As HttpApplication = TryCast(sender, HttpApplication)app.Response.Write(footerContent)End Sub
    B. Public Sub Init(ByVal app As HttpApplication) _ Implements IHttpModule.InitAddHandler app.EndRequest, AddressOf app_EndRequestEnd SubSub app_EndRequest(ByVal sender As Object, ByVal e As EventArgs)Dim app As HttpApplication = New HttpApplication()app.Response.Write(footerContent)End Sub
    C. Public Sub New()Dim app As HttpApplication = New HttpApplication()AddHandler app.EndRequest, AddressOf app_EndRequestEnd SubSub app_EndRequest(ByVal sender As Object, ByVal e As EventArgs)Dim app As HttpApplication = TryCast(sender, HttpApplication)app.Response.Write (footerContent)End Sub
    D. Public Sub Init(ByVal app As HttpApplication) _ Implements IHttpModule.InitAddHandler app.EndRequest, AddressOf app_EndRequestEnd SubSub app_EndRequest(ByVal sender As Object, ByVal e As EventArgs)Dim app As HttpApplication = TryCast(sender, HttpApplication) app.Response.Write(footerContent)End Sub

  • Question 115:

    You are implementing an ASP.NET Web site that will be accessed by an international audience. The site contains global and local resources for display elements that must be translated into the language that is selected by the user. You need to ensure that the Label control named lblCompany displays text in the users selected language from the global resource file. Which control markup should you use?

    C. C.
    D. D.

  • Question 116:

    You are implementing an ASP.NET Web site. The site uses a component that must be dynamically configured before it can be used within site pages.

    You create a static method named SiteHelper.Configure that configures the component. You need to add a code segment to the Global.asax file that invokes the SiteHelper.Configure method the first time, and only the first time, that any page

    in the site is requested.

    Which code segment should you use?

    A. Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) SiteHelper.Configure()End Sub
    B. Sub Application_Init(ByVal sender As Object, ByVal e As EventArgs) SiteHelper.Configure()End Sub
    C. Sub Application_BeginRequest(ByVal sender As Object,ByVal e As EventArgs)SiteHelper.Configure() End Sub
    D. Dim lockObject As Object = New Object()Sub Application_BeginRequest(ByVal sender As Object,ByVal e As EventArgs)SyncLock (lockObject())SiteHelper.Configure()End SyncLockEnd Sub

  • Question 117:

    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.

    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.vb code-behind file.Public ReadOnly Property CityName As StringGetReturn "New York"End GetEnd Property
    B. Add the following line of code to the TestUserControl.ascx.vb code-behind file.Protected ReadOnly CityName As String = "New York"
    C. Add the following code segment to the TestPage.aspx.vb code-behind file.Protected Sub Page_Load (ByVal sender As Object,ByVal e As System.EventArgs) Handles Me.LoadDim s As String = testControl.CityName End Sub
    D. Add the following code segment to the TestPage.aspx.vb code-behind file.Protected Sub Page_Load (ByVal sender As Object,ByVal e As System.EventArgs) Handles Me.LoadDim s As String = testControl.Attributes("CityName")End Sub

  • Question 118:

    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.

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

  • Question 119:

    You are developing an ASP.NET MVC 2 application.

    You create a view that will be returned by action methods in multiple controllers.

    You need to place the view in the appropriate folder.

    To which subfolder within the Views folder should you add the view?

    A. Master
    B. Default
    C. Shared
    D. Common

  • Question 120:

    You are implementing custom ASP.NET server controls.

    You have a base class named RotaryGaugeControl and two subclasses named CompassGaugeControl and SpeedGaugeControl.

    Each control requires its own client JavaScript code in order to function properly. The JavaScript includes functions that are used to create the proper HTML elements for the control. You need to ensure that the JavaScript for each of these

    controls that is used in an ASP.NET page is included in the generated HTML page only once, even if the ASP.NET page uses multiple instances of the given control.

    What should you do?

    A. Place the JavaScript in a file named controls.js and add the following code line to the Page_Load method of each control.Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "script","controls.js");
    B. Add the following code line to the Page_Load method of each control, where strJavascript contains the JavaScript code for the control.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "script",strJavascript);
    C. Add the following code line to the Page_Load method of each control, where CLASSNAME is the name of the control class and strJavascript contains the JavaScript code for the control.Page.ClientScript.RegisterStartupScript(typeof (CLASSNAME), "script",strJavascript);
    D. Add the following code line to the Page_Load method of each control, where CLASSNAME is the name of the control class and strJavascript contains the JavaScript code for the control.Page.ClientScript.RegisterClientScriptBlock(typeof (CLASSNAME), "script",strJavascript);

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.