You need to log health-monitoring events with severity level of error to the Windows application event log
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?
Which code segment should you use?
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?
You need to ensure that the application can invoke the target service by using the router endpoint
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?
Which deployment method should you choose?
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?
You need to ensure that classes in the Web application project always reference the most recent version of the
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?
Which code segment should you add at line 07?
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)
10
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?
Which two actions should you perform?
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.)
Which control markup should you use?
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?
Which configuration should you add to the web.config file?
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?
Which two code segments should you use?
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.)