Slide 10.7: User interface: Default.aspx (cont.)
Slide 10.9: User interface: NextPage.aspx (cont.)
Home

User Interface: NextPage.aspx


This example includes two pages:
  • Default.aspx, which was discussed previously and
  • NextPage.aspx, which is shown below.
The NextPage.aspx page is displayed with the text “The author, xxx, is inserted/deleted.,” after the button “Insert” or “Delete” on the Default.aspx is clicked. Other than the Label or string, the NextPage.aspx page includes the following tools:


⇓ Using the dropdown list

(Simplified) NextPage.aspx
01<!DOCTYPE html>
03 <body>
04  <form id="form1" runat="server">
05   <asp:Label ID="Result" runat="server"></asp:Label>
06    <asp:SqlDataSource ID="authors" runat="server" ConnectionString=
07     "<%$ ConnectionStrings:ConnectionString %>" ProviderName=
08     "<%$ ConnectionStrings:ConnectionString.ProviderName %>"
09     SelectCommand="SELECT [authorName] FROM [authors]">
10    </asp:SqlDataSource>
11 
12    <asp:Button ID="home" runat="server" OnClick="home_Click" Text="Home"
13     PostBackUrl="~/Default.aspx" />
14    <asp:DropDownList ID="authorList" runat="server"
15     DataSourceID="authors" DataTextField="authorName"
16     DataValueField="authorName" AutoPostBack="True">
17   </asp:DropDownList>
18 
19   <asp:Repeater id="author" runat="server">
20    <HeaderTemplate>
21     <table border="1">
22      <tr><th>Author ID</th><th>Author Name</th><th>Email</th></tr>
23    </HeaderTemplate>
24 
25    <ItemTemplate>
26     <tr>
27      <td><%#DataBinder.Eval(Container.DataItem,"authorID")%></td>
28      <td><%#DataBinder.Eval(Container.DataItem,"authorName")%></td>
29      <td><%#DataBinder.Eval(Container.DataItem,"email")%></td>
30     </tr>
31    </ItemTemplate>
32 
33    <FooterTemplate>
34     </table>
35    </FooterTemplate>
36   </asp:Repeater>
37  </form>
38 </body>
39</html>