Which code segment you should insert at line 12?
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.
<asp:TextBox runat=”server” ID=”txtSearch” />
<asp:Button runat=”server” ID=”btnSearch” Text=”Search”
OnClick=”btnSearch_Click” />
<asp:GridView runat=”server” ID=”gridCities” />
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 {
03 DataSet objDS = new DataSet();
04 SqlDataAdapter objDA = new SqlDataAdapter(objCmd);
05 objDA.Fill(objDS);
06 gridCities.DataSource = objDs;
07 gridCities.DataBind();
08 Session[“ds”] = objDS;
09 }
10 protected void btnSearch_Click(object sender, EventArgs e)
11 {
12
13 }
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 12?
What additional step should you perform?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You use Windows Authentication for the application.
You set up NTFS file system permissions for the Sales group to access a particular file.
You discover that all the users are able to access the file.
You need to ensure that only the Sales group users can access the file.
What additional step should you perform?
What should you do?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The computer that hosts the ASP.NET Web application contains a local instance of Microsoft SQL Server 2005.
The instance uses Windows Authentication.
You plan to configure the membership providers and the role management providers.
You need to install the database elements for both the providers on the local computer.
What should you do?
should you use?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application uses ASP.NET AJAX, and you plan to deploy it in a Web farm
environment.
You need to configure SessionState for the application. Which code fragment
should you use?
Which code segment should you use?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You write the following code fragment.
<asp:DropDownList AutoPostBack=”true”
ID=”DropDownList1″ runat=”server”
onselectedindexchanged=
“DropDownList1_SelectedIndexChanged”>
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
</asp:DropDownList>
You also add a MultiView control named MultiView1 to the Web page. MultiView1 has three child View controls.
You need to ensure that you can select the View controls by using the DropDownList1 DropDownList control.
Which code segment should you use?
What should you do?
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 <asp:RequiredFieldValidator
02 ID=”rfValidator1″ runat=”server”
03 Display=”Dynamic” ControlToValidate=”TextBox1″
04
05 >
06
07 </asp:RequiredFieldValidator>
08
09 <asp:ValidationSummary DisplayMode=”List”
10 ID=”ValidationSummary1″ runat=”server” />
You need to ensure that the error message displayed in the validation control is also displayed in the validation summary list.
What should you do?
Which code segment should you insert at line 03?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application has a Web form file named MovieReviews.aspx.
The MovieReviews.aspx file connects to a LinqDataSource DataSource named LinqDataSource1 that has a primary key named MovieID.
The application has a DetailsView control named DetailsView1.
The MovieReviews.aspx file contains the following code fragment. (Line numbers are included for reference only.)
01 <asp:DetailsView ID=”DetailsView1″ runat=”server”
02 DataSourceID=”LinqDataSource1″
03
04 />
05 <Fields>
06 <asp:BoundField DataField=”MovieID” HeaderText=”MovieID”
07 InsertVisible=”False”
08 ReadOnly=”True” SortExpression=”MovieID” />
09 <asp:BoundField DataField=”Title” HeaderText=”Title”
10 SortExpression=”Title” />
11 <asp:BoundField DataField=”Theater” HeaderText=”Theater”
12 SortExpression=”Theater” />
13 <asp:CommandField ShowDeleteButton=”false”
14 ShowEditButton=”True” ShowInsertButton=”True” />
15 </Fields>
16 </asp:DetailsView>
You need to ensure that the users can insert and update content in the DetailsView1 control.
You also need to prevent duplication of the link button controls for the Edit and New operations.
Which code segment should you insert at line 03?
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 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?
<?xml version="1.0" encoding="utf-8" ?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You add an XmlDataSource control named XmlDataSource1 to the Web page. XmlDataSource1 is bound to an XML document with the following structure.
<?xml version=”1.0″ encoding=”utf-8″ ?>
<clients>
<client ID=”1″ Name=”John Evans” />
<client ID=”2″ Name=”Mike Miller”/>
…
</clients>
You also write the following code segment in the code-behind file of the Web page.
protected void BulletedList1_Click(
object sender, BulletedListEventArgs e) {
//…
}
You need to add a BulletedList control named BulletedList1 to the Web page that is bound
to XmlDataSource1.
Which code fragment should you use?
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?