ASP.NET Page /Admin/QuestionRating.aspx (C#)
Uses Code Behind Page Page /Admin/QuestionRating.aspx.cs (C#)
1: <%@ Page Language="C#" AutoEventWireup="true" Inherits="_QuestionRating" Codebehind="QuestionRating.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>Untitled Page</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"  
16:                 ForeColor="#333333" GridLines="None" PageSize="50">  
17:                 <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />  
18:                 <Columns>  
19:                     <asp:BoundField DataField="QuestionID" HeaderText="QuestionID" SortExpression="QuestionID" />  
20:                     <asp:BoundField DataField="Rating" HeaderText="Rating" SortExpression="Rating" />  
21:                     <asp:BoundField DataField="UserName" HeaderText="UserName" SortExpression="UserName" />  
22:                     <asp:BoundField DataField="InsertDate" HeaderText="InsertDate" SortExpression="InsertDate" />  
23:                 </Columns>  
24:                 <RowStyle BackColor="#EFF3FB" />  
25:                 <EditRowStyle BackColor="#2461BF" />  
26:                 <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />  
27:                 <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />  
28:                 <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />  
29:                 <AlternatingRowStyle BackColor="White" />  
30:             </asp:GridView>  
31:         <asp:SqlDataSource ID="SqlDataSource1" runat="server"  
32:             DeleteCommand="DELETE FROM [Comments] WHERE [CommmentID] = @CommmentID" InsertCommand="INSERT INTO [Comments] ([CommmentID], [CommentDateTime], [QuestionID], [Comment], [UserName]) VALUES (@CommmentID, @CommentDateTime, @QuestionID, @Comment, @UserName)"  
33:             SelectCommand="SELECT [CommmentID], [CommentDateTime], [QuestionID], [Comment], [UserName] FROM [Comments] order by CommmentID Desc"  
34:             UpdateCommand="UPDATE [Comments] SET [CommentDateTime] = @CommentDateTime, [QuestionID] = @QuestionID, [Comment] = @Comment, [UserName] = @UserName WHERE [CommmentID] = @CommmentID" ConnectionString="<%$ ConnectionStrings:QuiznetOnline.Data.Properties.Settings.Default.QuizNetOnlineConnectionString %>">  
35:             <DeleteParameters>  
36:                             <asp:Parameter Name="CommmentID" Type="Int32" />  
37:             </DeleteParameters>  
38:             <UpdateParameters>  
39:                             <asp:Parameter Name="CommentDateTime" Type="DateTime" />  
40:                             <asp:Parameter Name="QuestionID" Type="Int32" />  
41:                             <asp:Parameter Name="Comment" Type="String" />  
42:                             <asp:Parameter Name="UserName" Type="String" />  
43:                             <asp:Parameter Name="CommmentID" Type="Int32" />  
44:             </UpdateParameters>  
45:             <InsertParameters>  
46:                             <asp:Parameter Name="CommmentID" Type="Int32" />  
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:             </InsertParameters>  
52:         </asp:SqlDataSource>  
53:       
54:     </div>  
55:     </form>  
56: </body>  
57: </html>  

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