ASP.NET Page /Admin/Comments.aspx (C#)
Uses Code Behind Page Page /Admin/Comments.aspx.cs (C#)
1: <%@ Page Language="C#" AutoEventWireup="true" Inherits="Admin_Comments" Codebehind="Comments.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:                     <asp:TemplateField HeaderText="Reply">  
26:                         <ItemTemplate>  
27:                             <asp:TextBox runat="server" ID="txtReply" TextMode="MultiLine"></asp:TextBox>  
28:                             <asp:Button ID="cmdSend" runat="server" OnClick="cmdSend_Click" Text="Send" />  
29:                         </ItemTemplate>  
30:                     </asp:TemplateField>  
31:                 </Columns>  
32:                 <RowStyle BackColor="#EFF3FB" />  
33:                 <EditRowStyle BackColor="#2461BF" />  
34:                 <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />  
35:                 <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />  
36:                 <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />  
37:                 <AlternatingRowStyle BackColor="White" />  
38:             </asp:GridView>  
39:         <asp:SqlDataSource ID="SqlDataSource1" runat="server"  
40:             DeleteCommand="DELETE FROM [Comments] WHERE [CommmentID] = @CommmentID" InsertCommand="INSERT INTO [Comments] ([CommmentID], [CommentDateTime], [QuestionID], [Comment], [UserName]) VALUES (@CommmentID, @CommentDateTime, @QuestionID, @Comment, @UserName)"  
41:             SelectCommand="SELECT [CommmentID], [CommentDateTime], [QuestionID], [Comment], [UserName] FROM [Comments] order by CommmentID Desc"  
42:             UpdateCommand="UPDATE [Comments] SET [CommentDateTime] = @CommentDateTime, [QuestionID] = @QuestionID, [Comment] = @Comment, [UserName] = @UserName WHERE [CommmentID] = @CommmentID" ConnectionString="<%$ ConnectionStrings:QuiznetOnline.Data.Properties.Settings.Default.QuizNetOnlineConnectionString %>">  
43:             <DeleteParameters>  
44:                             <asp:Parameter Name="CommmentID" Type="Int32" />  
45:             </DeleteParameters>  
46:             <UpdateParameters>  
47:                             <asp:Parameter Name="CommentDateTime" Type="DateTime" />  
48:                             <asp:Parameter Name="QuestionID" Type="Int32" />  
49:                             <asp:Parameter Name="Comment" Type="String" />  
50:                             <asp:Parameter Name="UserName" Type="String" />  
51:                             <asp:Parameter Name="CommmentID" Type="Int32" />  
52:             </UpdateParameters>  
53:             <InsertParameters>  
54:                             <asp:Parameter Name="CommmentID" Type="Int32" />  
55:                             <asp:Parameter Name="CommentDateTime" Type="DateTime" />  
56:                             <asp:Parameter Name="QuestionID" Type="Int32" />  
57:                             <asp:Parameter Name="Comment" Type="String" />  
58:                             <asp:Parameter Name="UserName" Type="String" />  
59:             </InsertParameters>  
60:         </asp:SqlDataSource>  
61:       
62:     </div>  
63:     </form>  
64: </body>  
65: </html>  

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