NextPage.aspx
This example includes two pages:
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:
|
|
ID
“home,” whose destination is the page Default.aspx
,
ID
“authors,” whose source is the values of the column authorName
of the table authors
,
ID
“authorList,” whose contents are populated by the sqldatasource, and
ID
“author” for the detailed information of the author selected by the dropdownlist.
On the ASP.NET IDE, switch to source view to edit the control’s templates.
(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> |