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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
 <body>
  <form id="form1" runat="server">
   <asp:Label ID="Result" runat="server"></asp:Label>
    <asp:SqlDataSource ID="authors" runat="server" ConnectionString=
     "<%$ ConnectionStrings:ConnectionString %>" ProviderName=
     "<%$ ConnectionStrings:ConnectionString.ProviderName %>"
     SelectCommand="SELECT [authorName] FROM [authors]">
    </asp:SqlDataSource>

    <asp:Button ID="home" runat="server" OnClick="home_Click" Text="Home"
     PostBackUrl="~/Default.aspx" />
    <asp:DropDownList ID="authorList" runat="server"
     DataSourceID="authors" DataTextField="authorName"
     DataValueField="authorName" AutoPostBack="True">
   </asp:DropDownList>

   <asp:Repeater id="author" runat="server">
    <HeaderTemplate>
     <table border="1">
      <tr><th>Author ID</th><th>Author Name</th><th>Email</th></tr>
    </HeaderTemplate>

    <ItemTemplate>
     <tr>
      <td><%#DataBinder.Eval(Container.DataItem,"authorID")%></td>
      <td><%#DataBinder.Eval(Container.DataItem,"authorName")%></td>
      <td><%#DataBinder.Eval(Container.DataItem,"email")%></td>
     </tr>
    </ItemTemplate>

    <FooterTemplate>
     </table>
    </FooterTemplate>
   </asp:Repeater>
  </form>
 </body>
</html>