ASP.NET Page /Admin/UserSettings.aspx (C#)
Uses Code Behind Page Page /Admin/UserSettings.aspx.cs (C#)
1: <%@ Page Language="C#" AutoEventWireup="true" Inherits="UserSettings" Codebehind="UserSettings.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>  
13:                 <br />  
14:            
15:         <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"  
16:             AutoGenerateColumns="False" CellPadding="4" DataKeyNames="UserName" DataSourceID="SqlDataSource1"  
17:             ForeColor="#333333" GridLines="None" PageSize="50">  
18:             <PagerSettings PageButtonCount="50" />  
19:             <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />  
20:             <Columns>  
21:                             <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />  
22:                 <asp:BoundField DataField="UserName" HeaderText="UserName" ReadOnly="True" SortExpression="UserName" />  
23:                 <asp:CheckBoxField DataField="UnlimitedQuestions" HeaderText="UnlimitedQuestions"  
24:                     SortExpression="UnlimitedQuestions" />  
25:                 <asp:BoundField DataField="NumberOfTestsTaken" HeaderText="NumberOfTestsTaken" SortExpression="NumberOfTestsTaken" />  
26:                 <asp:BoundField DataField="NumberOfQuestionsCorrect" HeaderText="NumberOfQuestionsCorrect"  
27:                     SortExpression="NumberOfQuestionsCorrect" />  
28:                 <asp:BoundField DataField="NumberOfQuestionsIncorrect" HeaderText="NumberOfQuestionsIncorrect"  
29:                     SortExpression="NumberOfQuestionsIncorrect" />  
30:                 <asp:BoundField DataField="DateOfLastTest" HeaderText="DateOfLastTest" SortExpression="DateOfLastTest" />  
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" ConnectionString="<%$ ConnectionStrings:QuiznetOnline.Data.Properties.Settings.Default.QuizNetOnlineConnectionString %>"  
40:             SelectCommand="SELECT [UserName], [UnlimitedQuestions], [NumberOfTestsTaken], [NumberOfQuestionsCorrect], [NumberOfQuestionsIncorrect], [DateOfLastTest] FROM [UserSettings]" ConflictDetection="CompareAllValues"  
41:             DeleteCommand="DELETE FROM [UserSettings] WHERE [UserName] = @original_UserName"  
42:             InsertCommand="INSERT INTO [UserSettings] ([UserName], [UnlimitedQuestions], [NumberOfTestsTaken], [NumberOfQuestionsCorrect], [NumberOfQuestionsIncorrect], [DateOfLastTest]) VALUES (@UserName, @UnlimitedQuestions, @NumberOfTestsTaken, @NumberOfQuestionsCorrect, @NumberOfQuestionsIncorrect, @DateOfLastTest)" OldValuesParameterFormatString="original_{0}"  
43:             UpdateCommand="UPDATE [UserSettings] SET [UnlimitedQuestions] = @UnlimitedQuestions, [NumberOfTestsTaken] = @NumberOfTestsTaken, [NumberOfQuestionsCorrect] = @NumberOfQuestionsCorrect, [NumberOfQuestionsIncorrect] = @NumberOfQuestionsIncorrect, [DateOfLastTest] = @DateOfLastTest WHERE [UserName] = @original_UserName">  
44:                     <DeleteParameters>  
45:                         <asp:Parameter Name="original_UserName" Type="String" />  
46:                         <asp:Parameter Name="original_UnlimitedQuestions" Type="Boolean" />  
47:                         <asp:Parameter Name="original_NumberOfTestsTaken" Type="Int32" />  
48:                         <asp:Parameter Name="original_NumberOfQuestionsCorrect" Type="Int32" />  
49:                         <asp:Parameter Name="original_NumberOfQuestionsIncorrect" Type="Int32" />  
50:                         <asp:Parameter Name="original_DateOfLastTest" Type="DateTime" />  
51:                     </DeleteParameters>  
52:                     <UpdateParameters>  
53:                         <asp:Parameter Name="UnlimitedQuestions" Type="Boolean" />  
54:                         <asp:Parameter Name="NumberOfTestsTaken" Type="Int32" />  
55:                         <asp:Parameter Name="NumberOfQuestionsCorrect" Type="Int32" />  
56:                         <asp:Parameter Name="NumberOfQuestionsIncorrect" Type="Int32" />  
57:                         <asp:Parameter Name="DateOfLastTest" Type="DateTime" />  
58:                         <asp:Parameter Name="original_UserName" Type="String" />  
59:                         <asp:Parameter Name="original_UnlimitedQuestions" Type="Boolean" />  
60:                         <asp:Parameter Name="original_NumberOfTestsTaken" Type="Int32" />  
61:                         <asp:Parameter Name="original_NumberOfQuestionsCorrect" Type="Int32" />  
62:                         <asp:Parameter Name="original_NumberOfQuestionsIncorrect" Type="Int32" />  
63:                         <asp:Parameter Name="original_DateOfLastTest" Type="DateTime" />  
64:                     </UpdateParameters>  
65:                     <InsertParameters>  
66:                         <asp:Parameter Name="UserName" Type="String" />  
67:                         <asp:Parameter Name="UnlimitedQuestions" Type="Boolean" />  
68:                         <asp:Parameter Name="NumberOfTestsTaken" Type="Int32" />  
69:                         <asp:Parameter Name="NumberOfQuestionsCorrect" Type="Int32" />  
70:                         <asp:Parameter Name="NumberOfQuestionsIncorrect" Type="Int32" />  
71:                         <asp:Parameter Name="DateOfLastTest" Type="DateTime" />  
72:                     </InsertParameters>  
73:         </asp:SqlDataSource>  
74:       
75:     </div>  
76:     </form>  
77: </body>  
78: </html>  

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