User Control Page /Controls/UserSearchQuestion.ascx (C#)
Uses Code Behind Page Page /Controls/UserSearchQuestion.ascx.cs (C#)
1: <%@ Control Language="C#" AutoEventWireup="True" Inherits="QuiznetOnline.Web.UI.Controls.UserSearchQuestion" CodeBehind="UserSearchQuestion.ascx.cs" %>  
2:   
3: <asp:HiddenField runat="server" ID="hiddenUserName" />  
4:   
5: <asp:UpdateProgress ID="UpdateProgress1" runat="server">  
6:     <ProgressTemplate>  
7:         <img src="Images/ajax-loader.gif" alt=""/> Loading ...  
8:     </ProgressTemplate>  
9: </asp:UpdateProgress>                  
10:   
11: <table border="0">  
12: <tr>  
13:     <td>  
14:         <asp:TextBox ID="txtQuestionSearch"  runat="server"/>  
15:         <asp:DropDownList runat="server" ID="cmbSearchType">  
16:             <asp:ListItem Value="0" Text="Match any" Selected="True"/>  
17:             <asp:ListItem Value="1" Text="Match all"/>  
18:             <asp:ListItem Value="2" Text="Exact match"/>  
19:         </asp:DropDownList>  
20:         <asp:Button ID="cmdSearch" Text="Search" runat="server" OnClick="cmdSearch_Click" />  
21:     </td>  
22: </tr>  
23: <tr>      
24:     <td>  
25:       
26:         <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">  
27:         <ContentTemplate>  
28:       
29:             <asp:GridView ID="grdResults" runat="server"  
30:                 AutoGenerateColumns="False" Font-Names="Arial" Font-Size="X-Small"  
31:                 BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px"  
32:                 CellPadding="3" EnableModelValidation="True" GridLines="Horizontal" OnRowCommand="grdResults_RowCommand"  
33:                 DataKeyNames="QuestionID" AllowPaging="True" OnPageIndexChanging="grdResults_PageIndexChanging" PageSize="30">  
34:   
35:                 <PagerStyle ForeColor="Black" HorizontalAlign="Right" BackColor="#C6C3C6"></PagerStyle>  
36:                 <AlternatingRowStyle BackColor="#F7F7F7" />  
37:             <Columns>  
38:                 <asp:TemplateField>  
39:                     <ItemTemplate>  
40:                         <asp:LinkButton ID="SelectButton" Text="Select" CommandName="Select" runat="server"/>  
41:                     </ItemTemplate>  
42:                 </asp:TemplateField>  
43:                 <asp:TemplateField HeaderText="My searched questions - hover over for answers">  
44:                     <ItemTemplate>  
45:                         <asp:Label ID="lblQuestionDesc" runat="server" Text='<%# bind("QuestionDesc") %>' ToolTip='<%# bind("AnswerDesc") %>'/>  
46:                     </ItemTemplate>  
47:                 </asp:TemplateField>  
48:             </Columns>  
49:                 <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />  
50:                 <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />  
51:                 <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />  
52:                 <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />  
53:                 <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />  
54:   
55:             <pagersettings mode="NextPreviousFirstLast"  
56:                 position="Top" />  
57:   
58:             <pagerstyle backcolor="LightBlue"  
59:                 height="30px"  
60:                 Font-Size="Large"  
61:                 verticalalign="Bottom"  
62:                 horizontalalign="Center"/>  
63:   
64:             <emptydatatemplate>  
65:                 <asp:Label runat="server" ID="lblEmptyData" Text="No questions found matching your search" />  
66:             </emptydatatemplate>  
67:   
68:             </asp:GridView>  
69:             <table border="1" width="100%" style="background-color:LightBlue">  
70:             <tr>  
71:                 <td align="center">  
72:                     <i>You are viewing page  
73:                         <%=grdResults.PageIndex + 1%>  
74:                         of  
75:                         <%=grdResults.PageCount%>  
76:                     </i>  
77:                 </td>  
78:             </tr>  
79:             </table>  
80:   
81:         </ContentTemplate>  
82:         </asp:UpdatePanel>  
83:     </td>  
84: </tr>  
85: </table>

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