ASP.NET Page /Admin/Enquiry.aspx (C#)
Uses Code Behind Page Page /Admin/Enquiry.aspx.cs (C#)
1: <%@ Page Language="C#" AutoEventWireup="true" Inherits="Enquiry" Codebehind="Enquiry.aspx.cs" %>  
2:   
3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
4:   
5: <html xmlns="http://www.w3.org/1999/xhtml" >  
6: <head runat="server">  
7:     <title>Admin - Comments maintenance</title>  
8: </head>  
9: <body>  
10:     <form id="form1" runat="server">  
11:     <div>  
12:         <asp:HyperLink ID="lblHome" runat="server" NavigateUrl="~/Admin/Default.aspx">Home</asp:HyperLink><br />  
13:             
14:             <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"  
15:                 AutoGenerateColumns="False" CellPadding="4" DataKeyNames="CommmentID" DataSourceID="SqlDataSource1"  
16:                 ForeColor="#333333" GridLines="None" PageSize="50">  
17:                 <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />  
18:                 <Columns>  
19:                     <asp:CommandField ShowDeleteButton="True" />  
20:                     <asp:BoundField DataField="CommmentID" HeaderText="CommmentID" ReadOnly="True" SortExpression="CommmentID" />  
21:                     <asp:BoundField DataField="CommentDateTime" HeaderText="CommentDateTime" SortExpression="CommentDateTime" />  
22:                     <asp:BoundField DataField="QuestionID" HeaderText="QuestionID" SortExpression="QuestionID" />  
23:                     <asp:BoundField DataField="Comment" HeaderText="Comment" SortExpression="Comment" />  
24:                     <asp:BoundField DataField="UserName" HeaderText="UserName" SortExpression="UserName" />  
25:                 </Columns>  
26:                 <RowStyle BackColor="#EFF3FB" />  
27:                 <EditRowStyle BackColor="#2461BF" />  
28:                 <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />  
29:                 <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />  
30:                 <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />  
31:                 <AlternatingRowStyle BackColor="White" />  
32:             </asp:GridView>  
33:         <asp:SqlDataSource ID="SqlDataSource1" runat="server"  
34:             DeleteCommand="DELETE FROM [Comments] WHERE [CommmentID] = @CommmentID" InsertCommand="INSERT INTO [Comments] ([CommmentID], [CommentDateTime], [QuestionID], [Comment], [UserName]) VALUES (@CommmentID, @CommentDateTime, @QuestionID, @Comment, @UserName)"  
35:             SelectCommand="SELECT [CommmentID], [CommentDateTime], [QuestionID], [Comment], [UserName] FROM [Comments] order by CommmentID Desc"  
36:             UpdateCommand="UPDATE [Comments] SET [CommentDateTime] = @CommentDateTime, [QuestionID] = @QuestionID, [Comment] = @Comment, [UserName] = @UserName WHERE [CommmentID] = @CommmentID" ConnectionString="<%$ ConnectionStrings:QuiznetOnline.Data.Properties.Settings.Default.QuizNetOnlineConnectionString %>">  
37:             <DeleteParameters>  
38:                             <asp:Parameter Name="CommmentID" Type="Int32" />  
39:             </DeleteParameters>  
40:             <UpdateParameters>  
41:                             <asp:Parameter Name="CommentDateTime" Type="DateTime" />  
42:                             <asp:Parameter Name="QuestionID" Type="Int32" />  
43:                             <asp:Parameter Name="Comment" Type="String" />  
44:                             <asp:Parameter Name="UserName" Type="String" />  
45:                             <asp:Parameter Name="CommmentID" Type="Int32" />  
46:             </UpdateParameters>  
47:             <InsertParameters>  
48:                             <asp:Parameter Name="CommmentID" Type="Int32" />  
49:                             <asp:Parameter Name="CommentDateTime" Type="DateTime" />  
50:                             <asp:Parameter Name="QuestionID" Type="Int32" />  
51:                             <asp:Parameter Name="Comment" Type="String" />  
52:                             <asp:Parameter Name="UserName" Type="String" />  
53:             </InsertParameters>  
54:         </asp:SqlDataSource>  
55:       
56:     </div>  
57:     </form>  
58: </body>  
59: </html>  

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