ASP.NET Page /Admin/TableSequence.aspx (C#)
Uses Code Behind Page Page /Admin/TableSequence.aspx.cs (C#)
1: <%@ Page Language="C#" AutoEventWireup="true" Inherits="Admin_TableSequence" Codebehind="TableSequence.aspx.cs" %>  
2:   
3:   
4:   
5: <html xmlns="http://www.w3.org/1999/xhtml" >  
6: <head runat="server">  
7:     <title>Admin - Table sequence maintenance</title>  
8: </head>  
9: <body>  
10:     <form id="form1" runat="server">  
11:     <asp:HyperLink ID="lblHome" runat="server" NavigateUrl="~/Admin/Default.aspx">Home</asp:HyperLink>  
12:     <div>  
13:          <asp:FormView ID="FormView1" runat="server" AllowPaging="True" DataKeyNames="TableName"  
14:             DataSourceID="SqlDataSource1">  
15:             <PagerSettings Mode="NextPreviousFirstLast" Position="Top" />  
16:             <EditItemTemplate>  
17:                 TableName:  
18:                 <asp:Label ID="TableNameLabel1" runat="server" Text='<%# Eval("TableName") %>'></asp:Label><br />  
19:                 RecordNumber:  
20:                 <asp:TextBox ID="RecordNumberTextBox" runat="server" Text='<%# Bind("RecordNumber") %>'>  
21:                 </asp:TextBox><br />  
22:                 <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update"  
23:                     Text="Update">  
24:                 </asp:LinkButton>  
25:                 <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"  
26:                     Text="Cancel">  
27:                 </asp:LinkButton>  
28:             </EditItemTemplate>  
29:             <InsertItemTemplate>  
30:                 TableName:  
31:                 <asp:TextBox ID="TableNameTextBox" runat="server" Text='<%# Bind("TableName") %>'>  
32:                 </asp:TextBox><br />  
33:                 RecordNumber:  
34:                 <asp:TextBox ID="RecordNumberTextBox" runat="server" Text='<%# Bind("RecordNumber") %>'>  
35:                 </asp:TextBox><br />  
36:                 <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert"  
37:                     Text="Insert">  
38:                 </asp:LinkButton>  
39:                 <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"  
40:                     Text="Cancel">  
41:                 </asp:LinkButton>  
42:             </InsertItemTemplate>  
43:             <ItemTemplate>  
44:                 TableName:  
45:                 <asp:Label ID="TableNameLabel" runat="server" Text='<%# Eval("TableName") %>'></asp:Label><br />  
46:                 RecordNumber:  
47:                 <asp:Label ID="RecordNumberLabel" runat="server" Text='<%# Bind("RecordNumber") %>'>  
48:                 </asp:Label><br />  
49:                 <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit"  
50:                     Text="Edit">  
51:                 </asp:LinkButton>  
52:                 <asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete"  
53:                     Text="Delete">  
54:                 </asp:LinkButton>  
55:                 <asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" CommandName="New"  
56:                     Text="New">  
57:                 </asp:LinkButton>  
58:             </ItemTemplate>  
59:         </asp:FormView>  
60:         <asp:SqlDataSource ID="SqlDataSource1" runat="server"  
61:             DeleteCommand="DELETE FROM [TableSequence] WHERE [TableName] = @original_TableName AND [RecordNumber] = @original_RecordNumber"  
62:             InsertCommand="INSERT INTO [TableSequence] ([TableName], [RecordNumber]) VALUES (@TableName, @RecordNumber)"  
63:             OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [TableSequence]"  
64:             UpdateCommand="UPDATE [TableSequence] SET [RecordNumber] = @RecordNumber WHERE [TableName] = @original_TableName AND [RecordNumber] = @original_RecordNumber">  
65:             <DeleteParameters>  
66:                 <asp:Parameter Name="original_TableName" Type="String" />  
67:                 <asp:Parameter Name="original_RecordNumber" Type="Int32" />  
68:             </DeleteParameters>  
69:             <UpdateParameters>  
70:                 <asp:Parameter Name="RecordNumber" Type="Int32" />  
71:                 <asp:Parameter Name="original_TableName" Type="String" />  
72:                 <asp:Parameter Name="original_RecordNumber" Type="Int32" />  
73:             </UpdateParameters>  
74:             <InsertParameters>  
75:                 <asp:Parameter Name="TableName" Type="String" />  
76:                 <asp:Parameter Name="RecordNumber" Type="Int32" />  
77:             </InsertParameters>  
78:         </asp:SqlDataSource>  
79:       
80:     </div>  
81:     </form>  
82: </body>  
83: </html>  

.NET Documentation Tool is © 2002 - 2009 Winnersh Triangle Web Solutions Limited.