[Free] Get all latest Microsoft 70-515 Actual Tests 21-30

Ensurepass

QUESTION 21

You deploy an ASP.NET application to an IIS server. You need to log health-monitoring events with severity level of error to the Windows application event log. What should you do?

 

A.

Run the aspnet_regiis.exe command.

B.

Select the Treat all warnings as errors option in the project properties and recompile.

C.

Add the following rule to the healthMonitoring section of the web.config file. <rules> <add name=”Failures”eventName=”Failure Audits”provider=”EventLogProvider” /> </rules>

D.

Add the following rule to the healthMonitoring section of the web.config file. <rules> <add name=”Errors”eventName=”All Errors”provider=”EventLogProvider” /> </rules>

 

Correct Answer: D

 

 

QUESTION 22

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.

Dim isMember As Boolean =

Roles.GetUsersInRole (“Administrators”).Any()

B.

Dim isMember As Boolean =

Membership.ValidateUser ( User.Identity.Name , “Administrators”)

C.

Dim isMember As Boolean =

Roles.GetRolesForUser (“Administrators”).Any ()

D.

Dim isMember As Boolean = User.IsInRole (“Administrators”)

 

Correct Answer: D

 

 

QUESTION 23

You are creating an ASP.NET Web application. The application must call a WCF service by using a WCF routing service. You need to ensure that the application can invoke the target service by using the router endpoint. What should you do?

 

A.

Add a service reference to the router service. In the client binding configuration, specify the address of the router service.

B.

Add a service reference to the target service. In the client binding configuration, specify the address of the target service.

C.

Add a service reference to the router service. In the client binding configuration, specify the address of the target service.

D.

Add a service reference to the target service. In the client binding configuration, specify the address of the router service.

 

Correct Answer: D

 

 

QUESTION 24

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

 

Correct Answer: C

 

 

QUESTION 25

You use the ASP.NET Web Application template to create an application in a new Visual Studio solution. The project uses types that are defined in a class library project. Source code for the class library is frequently modified. You need to ensure that classes in the Web application project always reference the most recent version of the class library types. What should you do?

 

A.

Add the class library project to the solution. Modify the class library project to add a reference to the Web application project.

B.

Add the class library project to the solution. Modify the Web application project to add a reference to the class library project.

C.

Add a post-build step to the Web application project that copies the most recent version of the class library assembly to the bin folder of the Web application.

D.

Add a post-build step to the class library project that copies the most recent version of the class library assembly to the App_Code folder of the Web application. In the <compilation /> section of the web.config file, add an <assembly /> entry that specifies the location of the class library assembly.

 

Correct Answer: B

 

 

QUESTION 26

You are developing an ASP.NET Web page.

 

The page contains the following markup.

 

<asp:GridView ID=”gvModels” runat=”server”

 

onrowdatabound=”gvModels_RowDataBound”

 

AutoGenerateColumns=”false”>

 

<Columns>

 

<asp:BoundField DataField=”Name” HeaderText=”Model” />

 

<asp:TemplateField>

 

<ItemTemplate>

 

<asp:Image ID=”img” runat=”server” />

 

</ItemTemplate>

 

</asp:TemplateField>

 

</Columns>

 

</asp:GridView>

 

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)

 

07

 

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)

 

Correct Answer: B

 

 

QUESTION 27

You use the following declaration to add a Web user control named TestUserControl.ascx to an ASP.NET page named TestPage.aspx.

 

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

 

You add the following code to the code-behind file of TestPage.aspx.

 

Private Sub TestMethod()

 

End Sub

 

You define the following delegate.

 

Public Delegate Sub MyEventHandler()

 

You need to add an event of type MyEventHandler named MyEvent to TestUserControl.ascx and attach the pages TestMethod method to the event.

 

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

 

A.

Add the following line of code to TestUserControl.ascx.vb.

Public Event MyEvent As MyEventHandler

B.

Add the following line of code to TestUserControl.ascx.vb.

Public MyEvent As MyEventHandler

C.

Replace the TestUserControl.ascx reference in TestPage.aspx with the following declaration.

<uc:TestUserControl ID=”testControl” runat=”server” OnMyEvent=”TestMethod”/>

D.

D.Replace the TestUserControl.ascx reference in TestPage.aspx with the following declaration.

<uc:TestUserControl ID=”testControl” runat=”server” MyEvent=”TestMethod”/>

 

Correct Answer: AC

Explanation:

CHAPTER 7 Creating Custom Web Controls

Lesson 1: Creating User Controls

Defining User Control Events (page 333-337)

 

 

QUESTION 28

You are implementing an ASP.NET page that includes a text box. You need to validate values that are typed by users to ensure that only numeric values are submitted. Which control markup should you use?

 

A.

<asp:TextBox ID=”txt1″ runat=”server”

CausesValidation=”true”

ValidationGroup=”Numeric” />

B.

<asp:TextBox ID=”txt1″ runat=”server”

EnableClientScript=”true”

ValidationGroup=”Numeric” />

C.

<asp:TextBox ID=”txt1″ runat=”server” />

<asp:RegularExpressionValidator ID=”val1″

runat=”server”

ControlToValidate=”txt1″

ValidationExpression=”[0-9]*”

ErrorMessage=”Invalid input value” />

D.

<asp:TextBox ID=”txt1″ runat=”server” />

<asp:RegularExpressionValidator ID=”val1″

EnableClientScript=”true”

ControlToValidate=”txt1″

ValidationExpression=”[0-9]*”

ErrorMessage=”Invalid input value” />

 

Correct Answer: C

Explanation:

JavaScript executes as users enter and leave the focus of the controls on your page. Client-side validation is turned on by default. You can turn it off for specific validation controls by setting the EnableClientScript property to false.

CHAPTER 5 Input Validation and Site Navigation

Lesson 1: Performing Input Validation

Client-Side Validation (page 231)

 

 

QUESTION 29

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.

 

clip_image002Class name: Task

clip_image002[1]Namespace: DevControls

clip_image002[2]Assembly: TestServerControl.dll

clip_image002[3]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>

 

Correct Answer: C

Explanation:

CHAPTER 7 Creating Custom Web Controls

Lesson 2: Creating Custom Web Server Controls

Registering Your Controls in Web.config (page 378-379)

 

 

QUESTION 30

You are implementing an ASP.NET Web page. You need to add a text box that allows only values between 1 and 10, inclusive, to be submitted. Which two code segments should you use? (Each correct answer presents part of the solution. Choose two.)

 

A.

<script type=”text/javascript”>

function validate_value(obj, args) {

return

(args.Value >= 1 && args.Value <= 10);

}

</script>

B.

<script type=”text/javascript”>

function validate_value(obj, args) {

args.IsValid =

(args.Value >= 1 && args.Value <= 10);

}

</script>

C.

<asp:TextBox ID=”txt1″ runat=”server” />

<asp:CustomValidator ID=”val1″ runat=”server”

ControlToValidate=”txt1″

ClientValidationFunction=”validate_value”

ErrorMessage=”Value invalid” />

D.

<asp:TextBox ID=”txt1″ runat=”server” onChange=”validate_value(this, args)” />

 

Correct Answer: BC

Explanation:

CHAPTER 5 Input Validation and Site Navigation

Lesson 1: Performing Input Validation

The CustomValidator Control

 

Instant Access to Download Testing Software & PDF File for Microsoft 70-515 Real Exam

Instant Access to Try Microsoft 70-515 Free Demo

This entry was posted in 70-515 Actual Tests and tagged , , , , , . Bookmark the permalink.