Question:
You are developing a Web application. You add a SqlDataSource Web control named EmployeeSqlDataSource. You change the DataSource property of the EmployeeSqlDataSource control to a Microsoft SQL Server database table named Employees that contains all employees.
You have the following requirements:
Ensure that the Web application displays and allows editing of only one employee at a time and that additional employees could be displayed and edited using a pager. Ensure that you can control the markup rendered by Web controls. You need to add a code segment that meets the requirements. Which code segment should you use? (More than one answer choice may achieve the goal. Select the BEST answer.)
A
<asp:Repeater ID="EmployeeRepeater" runat="server" DataSourceID="EmployeeSqlDataSource"> <ItemTemplate>& </ItemTemplate>
</asp:Repeater>
<asp:DataList ID="EmployeeDataList" runat="server" DataKeyField="EmployeeId" DataSourceID="EmployeeSqlDataSource">
<ItemTemplate>& </ItemTemplate>
<EditItemTemplate>& </EditItemTemplate>
</asp:DataList>
B
<asp:FormView ID="EmployeeFormView" runat="server" AllowPaging="True" DataSourceID="EmployeeSqlDataSource" EnableModelValidation="True"> <ItemTemplate>& </ItemTemplate>
<EditItemTemplate>& </EditItemTemplate>
<PagerTemplate>& </PagerTemplate>
</asp:FormView>
C
<asp:ListView ID="EmployeeListView" runat="server" DataSourceID="EmployeeSqlDataSource" EnableModelValidation="True">
&
</asp:ListView>
D
<asp:DataPager ID="EmployeeDataPager" runat="server" PagedControlID="EmployeeListView" PageSize="1" >
<Fields>
<asp:NextPreviousPagerField ButtonType="Button"
ShowFirstPageButton="True"
ShowLastPageButton="True" />
</Fields>
</asp:DataPager>
+ AnswerC
+ Report