What should you do?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a Web page that contains the following two XML fragments. (Line numbers are included for reference only.)
01 <script runat=”server”>
02
03 </script>
04 <asp:ListView ID=”ListView1″ runat=”server”
05 DataSourceID=”SqlDataSource1″
06
07 >
08 <ItemTemplate>
09 <td>
10 <asp:Label ID=”LineTotalLabel” runat=”server”
11 Text='<%# Eval(“LineTotal”) %>’ />
12 </td>
13 </ItemTemplate>
The SqlDataSource1 object retrieves the data from a Microsoft SQL Server 2005 database table. The database table has a column named LineTotal.
You need to ensure that when the size of the LineTotal column value is greater than seven characters, the column is displayed in red color.
What should you do?
What should you do?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application contains two Web pages named OrderDetails.aspx and OrderError.htm.
If the application throws unhandled errors in the OrderDetails.aspx Web page, a stack trace is displayed to remote users.
You need to ensure that the OrderError.htm Web page is displayed for unhandled errors only in the OrderDetails.aspx Web page.
What should you do?
What should you do?
You create a Microsoft ASP.NET AJAX application by using the Microsoft .NET Framework version 3.5.
You use AJAX-enabled components in the Web page. You add a ScriptManager control to the page. The Web.config file has the following code fragment.
<deployment retail=”false” />
You receive an unhandled exception in the browser. You plan to debug the client-side script.
You need to ensure that the debug scripts are sent to the browser.
What should you do?
Which code fragment should you insert at line 11?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You add the following code fragment to the Web.config file of the application (Line numbers are included for reference only).
01 <healthMonitoring>
02 <providers>
03 <add name=”EventLogProvider”
04 type=”System.Web.Management.EventLogWebEventProvider
05 />
06 <add name=”WmiWebEventProvider”
07 type=”System.Web.Management.WmiWebEventProvider
08 />
09 </providers>
10 <eventMappings>
11
12 </eventMappings>
13 <rules>
14 <add name=”Security Rule” eventName=”Security Event”
15 provider=”WmiWebEventProvider” />
16 <add name=”AppError Rule” eventName=”AppError Event”
17 provider=”EventLogProvider” />
18 </rules>
19 </healthMonitoring>
You need to configure Web Events to meet the following requirements:
* Security-related Web Events are mapped to Microsoft Windows Management Instrumentation (WMI) events.
* Web Events caused by problems with configuration or application code are logged into the Windows Application Event Log.
Which code fragment should you insert at line 11?
What should you do?
You create a Microsoft ASP.NET AJAX application by using the Microsoft .NET Framework version 3.5.
You attach Microsoft Visual Studio 2008 debugger to the Microsoft Internet Explorer instance to debug the JavaScript code in the AJAX application.
You need to ensure that the application displays the details of the client-side object on the debugger console.
What should you do?
What should you do?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You add a Web page named HomePage.aspx in the application. The Web page contains different
controls. You add a newly created custom control named CachedControl to the Web page.
You need to ensure that the following requirements are met:
The custom control state remains static for one minute.
The custom control settings do not affect the cache settings of other elements in the
Web page.
What should you do?
Which code segment should you use?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a Web page named Default.aspx in the root of the application.
You add an ImageResources.resx resource file in the App_GlobalResources folder.
The ImageResources.resx file contains a localized resource named LogoImageUrl.
You need to retrieve the value of LogoImageUrl.
Which code segment should you use?
Which line of code should you insert in the constructor of the page?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a page that contains the following code fragment.
<asp:ListBox ID=”lstLanguages” AutoPostBack=”true” runat=”server” />
You write the following code segment in the code-behind file for the page.
void BindData(object sender, EventArgs e) {
lstLanguages.DataSource = CultureInfo.GetCultures(CultureTypes.AllCultures);
lstLanguages.DataTextField = “EnglishName”;
lstLanguages.DataBind();
}
You need to ensure that the lstLanguages ListBox control maintains the selection of the user during postback.
Which line of code should you insert in the constructor of the page?
What should you do?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application uses Session objects.
You are modifying the application to run on a Web farm.
You need to ensure that the application can access the Session objects from all the servers in the Web farm.
You also need to ensure that when any server in the Web farm restarts or stops responding, the Session objects are not lost.
What should you do?
Which code segment should you insert at line 16?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a Web page that has a GridView control named GridView1. The GridView1 control displays the data from a database named Region and a table named Location.
You write the following code segment to populate the GridView1 control. (Line numbers are included for reference only.)
01 protected void Page_Load(object sender, EventArgs e)
02 {
03 string connstr;
04
05 SqlDependency.Start(connstr);
06 using (SqlConnection connection =
07 new SqlConnection(connstr))
08 {
09 SqlCommand sqlcmd = new SqlCommand();
10 DateTime expires = DateTime.Now.AddMinutes(30);
11 SqlCacheDependency dependency = new
12 SqlCacheDependency(“Region”, “Location”);
13 Response.Cache.SetExpires(expires);
14 Response.Cache.SetValidUntilExpires(true);
15 Response.AddCacheDependency(dependency);
16
17 sqlcmd.Connection = connection;
18 GridView1.DataSource = sqlcmd.ExecuteReader();
19 GridView1.DataBind();
20 }
21 }
You need to ensure that the proxy servers can cache the content of the GridView1 control.
Which code segment should you insert at line 16?