1.
You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.
You use a state server named MyStateServer to enable session state for the application. The MyStateServer state server manages state for eight other Web applications.
You discover that the Web application receives a high number of timeout errors.
The SessionState element for the Web application is currently configured in the following manner.

You need to reduce the number of timeout errors. What should you do?
2.
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You plan to create a Web form to validate credit card information. You write the following code fragment for the Web form.

You need to implement the ValidateCreditCard method in the code-behind page class that validates the credit card number.
Which code segment should you use?
3.
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You store the following XML fragment in a string variable named xmlFragment in a Web form.

You need to display the value of the price attribute for each Product element that is contained in a ListBox control named lstPrices. Which code segment should you use?
4.
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a custom-templated server control.
You need to ensure that the child controls of the server control are uniquely identified within the control hierarchy of the page.
Which interface should you implement?
5.
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a set of resource files. The files contain localized text values for the controls in the application.
You need to ensure that each page in the application uses the localized text values. What should you do?
6.
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application uses a mobile Web form named Default.aspx. You write the following code segment. (Line numbers are included for reference only.)
01 MobileCapabilities curMobile;
02 curMobile = Request.Browser as MobileCapabilities;
The Web form contains a method named SetWmlSpecificInfo.
You need to ensure that each time the Web form is browsed from a browser that supports WML, the SetWmlSpecificInfo method is called.
Which code segment should you insert at line 03?
7.
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application is tested by 50 client computers. A high volume of Trace messages is generated. You need to ensure that the following requirements are met:
The Trace information is sent only to the trace.axd file.
The trace.axd file contains the latest trace information from a maximum of 10 last requests.
The trace.axd file is available only on the host Web server.
What should you add to the Trace element in the Web.config file?
8.
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a class that contains the following code segment. (Line numbers are included for reference only.)
01 public object GetCachedProducts(SqlConnection conn) {
02 if (Cache("products") Is Nothing) {
03 var cmd = new SqlCommand("SELECT * FROM Products", conn);
04 conn.Open();
05 Cache.Insert("products", GetData(cmd));
06 conn.Close();
07 }
08 return Cache("products");
09 }
10 public object GetData(SqlCommand prodCmd) {
12 }
Each time a Web form has to access a list of products, the GetCachedProducts method is called to provide this list from the Cache object.
You need to ensure that the list of products is always available in the Cache object.
Which code segment should you insert at line 11?
9.
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You write the following code segment in the code-behind file to create a Web form. (Line numbers are included for reference only.)
01 string strQuery = "select * from Products; select * from Categories";
02 var cmd = new SqlCommand(strQuery, cnn);
03 cnn.Open();
04 SqlDataAdapter rdr = cmd.ExecuteReader();
06 rdr.Close();
07 cnn.Close();
You need to ensure that the gvProducts and gvCategories GridView controls display the data that is contained in the following two database tables:
The Products database table
The Categories database table
Which code segment should you insert at line 05?
10.
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a custom control named OrderForm.
You write the following code segment.
public delegate void CheckOrderFormEventHandler(EventArgs e);
private static readonly object CheckOrderFormKey = new object();
public event CheckOrderFormEventHandler CheckOrderForm {
add { Events.AddHandler(CheckOrderFormKey, value); }
remove { Events.RemoveHandler(CheckOrderFormKey, value); }
}
You need to provide a method that enables the OrderForm control to raise the CheckOrderForm event.
Which code segment should you use?