ASP.NET Page /Admin/Log.aspx (C#)
Uses Code Behind Page Page /Admin/Log.aspx.cs (C#)
1: <%@ Page Language="C#" AutoEventWireup="true" Inherits="Admin_Log" Codebehind="Log.aspx.cs" %>  
2:   
3:   
4:   
5: <html xmlns="http://www.w3.org/1999/xhtml" >  
6: <head runat="server">  
7:     <title>Quiznetonline - Admin - Log maintenance</title>  
8:     <meta HTTP-EQUIV=REFRESH CONTENT=120>  
9: </head>  
10: <body>  
11:     <form id="form1" runat="server">  
12:     <asp:HyperLink ID="lblHome" runat="server" NavigateUrl="~/Admin/Default.aspx">Home</asp:HyperLink>  
13:     <div>  
14:     <center><asp:HyperLink ID="cmdWHOIS" runat="server" NavigateUrl="http://www.arin.net/whois/" target="_blank"></asp:HyperLink></center>  
15:       
16:     <asp:Label Runat="server" ID="WebResponseLabel" />  
17:           
18:         <table border="0">  
19:         <tr>  
20:             <td valign="top">  
21:                 <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"  
22:                     AutoGenerateColumns="False" DataSourceID="SqlDataSource1" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" PageSize="20">  
23:                     <Columns>  
24:                         <asp:CommandField ShowSelectButton="True" />  
25:                         <asp:BoundField DataField="LogDateTime" HeaderText="LogDateTime" ReadOnly="True"  
26:                             SortExpression="LogDateTime" />  
27:                         <asp:BoundField DataField="LogIP" HeaderText="LogIP" SortExpression="LogIP" />  
28:                         <asp:BoundField DataField="Occurances" HeaderText="Occurances" ReadOnly="True" SortExpression="Occurances" />  
29:                     </Columns>  
30:                 </asp:GridView>  
31:                 <asp:SqlDataSource ID="SqlDataSource1" runat="server"  
32:                     SelectCommand="SELECT cast(LogDateTime as nvarchar(12))as LogDateTime,LogIP,count(*) as Occurances FROM [Log] group by cast(LogDateTime as nvarchar(12)), [LogIP] order by LogDateTime desc">  
33:                 </asp:SqlDataSource>  
34:             </td>  
35:             <td>  
36:                 <asp:GridView ID="GridView2" runat="server" AllowPaging="True" AllowSorting="True"  
37:                     AutoGenerateColumns="False" DataSourceID="SqlDataSource2" PageSize="50" OnRowDataBound="GridView2_RowDataBound">  
38:                     <Columns>  
39:                         <asp:BoundField DataField="LogIP" HeaderText="LogIP" SortExpression="LogIP" />  
40:                         <asp:BoundField DataField="LogDateTime" HeaderText="LogDateTime" SortExpression="LogDateTime"/>  
41:                         <asp:BoundField DataField="LogArea" HeaderText="LogArea" SortExpression="LogArea" />  
42:                     </Columns>  
43:                 </asp:GridView>  
44:                 <asp:SqlDataSource ID="SqlDataSource2" runat="server"  
45:                     SelectCommand="SELECT * FROM [Log] ORDER BY [LogDateTime] DESC, [LogIP]"></asp:SqlDataSource>  
46:   
47:             </td>  
48:               
49:         </tr>  
50:         </table>  
51:       
52:     </div>  
53:         <asp:Button ID="cmdClear" runat="server" Text="Clear Log" OnClick="cmdClear_Click" />  
54:       
55:   
56:   
57:     </form>  
58: </body>  
59: </html>  

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