1.
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a Web form and add the following code fragment. The SqlDataSource1 DataSource control retrieves the Quantity column values from a table named Products. You write the following code segment to create the rptData_ItemDataBound event handler. (Line numbers are included for reference only.) 01 protected void rptData_ItemDataBound(object sender, RepeaterItemEventArgs e) 03 if (lbl != null) { 04 if (int.Parse(lbl.Text) < 10) { 05 lbl.ForeColor = Color.Red; 06 } 07 } 08 } You need to retrieve a reference to the lblQuantity Label control into a variable named lbl. Which code segment should you insert at line 02?
2.
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a composite custom control named MyControl. You need to add an instance of the OrderFormData control to the MyControl control. Which code segment should you use?
3.
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You write the following code fragment. You need to ensure that when you click the Button1 control, a selected list of items move from the ListBox1 control to the ListBox2 control. Which code segment should you use?
4.
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application contains a DataSourceControl named CategoriesDataSource that is bound to a Microsoft SQL Server 2005 table. The CategoryName column is the primary key of the table. You write the following code fragment in a FormView control. (Line numbers are included for reference only.) 01 02 Category: 03 04 10 11 You need to ensure that the changes made to the CategoryID field can be written to the database. Which code fragment should you insert at line 05?
5.
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You plan to add a custom parameter in the SqlDataSource control.
You write the following code fragment.







You write the following code segment to create a custom parameter class.
public class DayParameter : Parameter {
}
You need to ensure that the custom parameter returns the current date and time.
Which code segment should you add to the DayParameter class?
6.
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a FormView control to access the results of a query. The query contains the following fields:
EmployeID
FirstName
LastName
The user must be able to view and update the FirstName field.
You need to define the control definition for the FirstName field in the FormView control.
Which code fragment should you use?
7.
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a Web form that contains the following code fragment.

You write the following code segment in the code-behind file. (Line numbers are included for reference only.)
01 protected void Page_Load(object sender, EventArgs e) {
02 DataSet objDS = new DataSet();
03 SqlDataAdapter objDA = new SqlDataAdapter(objCmd);
04 objDA.Fill(objDS);
05 gridCities.DataSource = objDS;
06 gridCities.DataBind();
07 Session("ds") = objDS;
08 }
09 protected void btnSearch_Click(object sender, EventArgs e)
10
11 }
You need to ensure that when the btnSearch Button control is clicked, the records in the gridCities GridView
control are filtered by using the value of the txtSearch TextBox.
Which code segment you should insert at line 10?
8.
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You write the following code fragment. (Line numbers are included for reference only.)
01 02 ChildrenAsTriggers="false" UpdateMode="Conditional">
03
04
05

06
07
08
09
10

11

12
You need to ensure that the requirements shown in the following table are met.
What should you do?
9.
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a Web form in the application by using the following code fragment. (Line numbers are included for reference only.)
01
08
09
10
11
12
13
14

15

16

You plan to create a client-side script code by using ASP.NET AJAX.
You need to ensure that while a request is being processed, any subsequent Click events on the btnSubmit
Button control are suppressed.
Which code fragment should you insert at line 07?
10.
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You write the following code segment to create a JavaScript file named CalculatorScript.js. function divide(a, b) {
if (b == 0) {
var errorMsg = Messages.DivideByZero;
alert(errorMsg); return null;
}
return a/b;
}
You embed the CalculatorScript.js file as a resource in a Class Library project. The namespace for this project
is Calculator.Resources. The JavaScript function retrieves messages from a resource file named
MessageResources.resx by using the JavaScript Messages object.
You add an AJAX Web form in the ASP.NET application. You reference the Class Library in the application.
You add an ASP.NET AJAX ScriptReference element to the AJAX Web form.
You need to ensure that the JavaScript function can access the error messages that are defined in the resource file.
Which code segment should you add in the AssemblyInfo.vb file?