User Control Page /Controls/UserSelectedQuestion.ascx (C#)
Uses Code Behind Page Page /Controls/UserSelectedQuestion.ascx.cs (C#)
1: <%@ Control Language="C#" AutoEventWireup="True" Inherits="QuiznetOnline.Web.UI.Controls.UserSelectedQuestion" CodeBehind="UserSelectedQuestion.ascx.cs" %>  
2:   
3: <script type="text/javascript">  
4:     function SelectAll(id)  
5:     {  
6:         var frm = document.forms[0];  
7:         for (i=0;i<frm.elements.length;i++)  
8:         {  
9:             if (frm.elements[i].type == "checkbox")  
10:             {  
11:                   
12:                 frm.elements[i].checked = document.getElementById(id).checked;  
13:             }  
14:         }  
15:     }  
16: </script>  
17:   
18: <table>  
19: <tr>  
20:     <td>  
21:         <asp:Button ID="cmdDelete" Text="Delete" runat="server" OnClick="cmdDelete_Click" />  
22:     </td>  
23: </tr>  
24: <tr>      
25:     <td>  
26:         <asp:Panel runat="server" ID="panelSelected">  
27:             <asp:GridView ID="grdSelected" runat="server"  
28:                 AutoGenerateColumns="False" Font-Names="Arial" Font-Size="X-Small"  
29:                 BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px"  
30:                 CellPadding="3" OnRowDataBound="grdSelected_RowDataBound"  
31:                 AllowPaging="True" OnPageIndexChanging="grdSelected_PageIndexChanging" DataKeyNames="QuestionID" PageSize="30">  
32:   
33:                 <PagerStyle ForeColor="Black" HorizontalAlign="Right" BackColor="#C6C3C6"></PagerStyle>  
34:                 <AlternatingRowStyle BackColor="White" />  
35:                 <Columns>  
36:                     <asp:TemplateField>  
37:                         <HeaderTemplate>  
38:                             <asp:CheckBox ID="cbSelectAll" runat="server" Text="Delete" TextAlign="Right"/>  
39:                         </HeaderTemplate>  
40:                         <ItemTemplate>  
41:                                 <asp:CheckBox ID="chkDelete" runat="server"/>  
42:                         </ItemTemplate>  
43:                     </asp:TemplateField>  
44:                     <asp:BoundField DataField="QuestionDesc" HeaderText="My selected questions"  
45:                         SortExpression="QuestionDesc" />  
46:                 </Columns>  
47:                 <EditRowStyle BackColor="#7C6F57" />  
48:                 <FooterStyle BackColor="#1C5E55" ForeColor="White" Font-Bold="True" />  
49:                 <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />  
50:                 <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />  
51:                 <RowStyle BackColor="#E3EAEB" />  
52:                 <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />  
53:   
54:             <pagersettings mode="NextPreviousFirstLast"  
55:                 position="Top"/>  
56:   
57:             <pagerstyle backcolor="LightBlue"  
58:                 height="30px"  
59:                 Font-Size="Large"  
60:                 verticalalign="Bottom"  
61:                 horizontalalign="Center"/>  
62:   
63:                 <emptydatatemplate>  
64:                     <asp:Label runat="server" ID="lblEmptyData" Text="No questions has been selected" />  
65:                 </emptydatatemplate>  
66:             </asp:GridView>  
67:             <table border="1" width="100%" style="background-color:LightBlue">  
68:             <tr>  
69:                 <td align="center">  
70:                     <i>You are viewing page  
71:                         <%=grdSelected.PageIndex + 1%>  
72:                         of  
73:                         <%=grdSelected.PageCount%>  
74:                     </i>  
75:                 </td>  
76:             </tr>  
77:             </table>  
78:         </asp:Panel>  
79:     </td>  
80: </tr>  
81: </table>  
82:   
83:   

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