<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="pg_MessageSendNew.aspx.cs" Inherits="rl_admins_pg_MessageSendNew" Title="Untitled Page" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" Runat="Server">
    <div class="contentDiv">
        <table border="0" cellpadding="0" cellspacing="0" >
            <tr id="Tr1">
                <td id="rightTableData" valign="top">
                    <div id="linksPanel" style="margin-right:15px; margin-top : 10px;">
                        <table id="tblpanel" border="0" cellpadding="0" cellspacing="0" style="width:200px;">
                            <tr>
                                <td id="panelheadright" class="panelheadright">
                                </td>
                                <td id="panelheadrepeat" class="panelheadrepeat" align="center" style="width:160px;">
                                    <asp:Label ID="lblpanelHead" runat="server" Text="منوی سایت" style="color:White; font-weight:bold; "></asp:Label>
                                </td>
                                <td id="panelheadleft" class="panelheadleft">
                                </td>
                            </tr>
                            <tr>
                                <td id="panelmarginright" class="panelmarginright">
                                </td>
                                <td valign="top" class="panelcontentback" style="background-image:none; background-color : White; "> <!-- ************ Content Place !-->
                                    <div class="panelcontent" style="margin-top:17px;">
                                        <asp:Panel ID="panelMenues" runat="server">
                                        </asp:Panel>
                                    </div>
                                </td>
                                <td id="panelmarginleft" class="panelmarginleft" align="left">
                                </td>
                            </tr>
                            <tr>
                                <td id="panelbottomright" class="panelbottomright" align="right" >
                                </td>
                                <td id="panelbottomrepeat" class="panelbottomrepeat" style="width:160px;">
                                </td>
                                <td id="panelbottomleft" class="panelbottomleft" align="left";>
                                </td>
                            </tr>
                        </table>
                    </div>
                </td>
                <td id="contentTableData" style="width:100%; padding-right : 10px;" align="right"; valign="top"; >
                     <div id="frameContainer" style="padding:10px 10px 25px 10px;">
                        <table id="Table2" border="0" cellpadding="0" cellspacing="0" style="width:600px;">
                            <tr>
                                <td id="Td92" class="panelheadright">
                                </td>
                                <td id="Td102" class="panelheadrepeat" align="center" >
                                    <asp:Label ID="lblFrameTitle" runat="server" Text="ارسال پیام خصوصی" style="color:White;"></asp:Label>
                                </td>
                                <td id="Td112" class="panelheadleft">
                                </td>
                            </tr>
                            <tr>
                                <td id="Td122" class="panelmarginright">
                                </td>
                                <td valign="top" class="panelcontentback" > <!-- ************ Content Place !-->
                                    <div id="divRoleType" class="panelcontent" style="text-align:center; " runat="server">
                                        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                                            <ContentTemplate>
                                                <table>
                                                    <tr>
                                                        <td align="left" valign="top">
                                                            <asp:Label ID="Label1" runat="server" Text="نقش دریافت کننده :"></asp:Label>    
                                                        </td>
                                                        <td align="right" valign="top" colspan="2">
                                                            <asp:DropDownList ID="cmbRecieverRole" runat="server" Font-Names="Tahoma" 
                                                                Font-Size="8pt" Width="250px" AutoPostBack="True" 
                                                                onselectedindexchanged="cmbRecieverRole_SelectedIndexChanged">
                                                                <asp:ListItem></asp:ListItem>
                                                                <asp:ListItem>مدیر سایت</asp:ListItem>
                                                                <asp:ListItem>کارمند آموزشگاه</asp:ListItem>
                                                                <asp:ListItem>مدرس</asp:ListItem>
                                                                <asp:ListItem>دانشجو</asp:ListItem>
                                                                <asp:ListItem>کاربر سایت</asp:ListItem>
                                                            </asp:DropDownList>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="left" valign="top">
                                                            <asp:Label ID="Label2" runat="server" Text="دریافت کننده :"></asp:Label>    
                                                        </td>
                                                        <td align="right" valign="top">
                                                            <asp:TextBox ID="tbRecieverId" runat="server" ReadOnly="true" Width="60px" Font-Names="Tahoma" Font-Size="8pt" BackColor="Control"></asp:TextBox>
                                                            <asp:TextBox ID="tbRecieverUserName" runat="server" ReadOnly="true" Width="190px" Font-Names="Tahoma" Font-Size="8pt" BackColor="Control"></asp:TextBox>
                                                        </td>
                                                        <td align="right" valign="top">
                                                            <asp:LinkButton ID="btnSelectUser" runat="server" CssClass="gridsmallbuttons" 
                                                                Width="60px" Height="20px" style="margin-top:4px;" Enabled="False" 
                                                                onclick="btnSelectUser_Click" >انتخاب</asp:LinkButton>
                                                            <asp:Button ID="btnAddClasses2" runat="server" Text="" style="display:none;"/>
                                                            <cc1:ModalPopupExtender ID="mpeManagers" runat="server" 
                                                                 TargetControlID="btnAddClasses2" PopupControlID="panelManagers" 
                                                                 BackgroundCssClass="modalback" CacheDynamicResults="True">
                                                            </cc1:ModalPopupExtender>
                                                            <asp:Button ID="btnAdmins2" runat="server" Text="" style="display:none;"/>
                                                            <cc1:ModalPopupExtender ID="mpeAdmins" runat="server" 
                                                                 TargetControlID="btnAdmins2" PopupControlID="panelAdmins" 
                                                                 BackgroundCssClass="modalback" CacheDynamicResults="True">
                                                            </cc1:ModalPopupExtender>
                                                            <asp:Button ID="btnTeachers2" runat="server" Text="" style="display:none;"/>
                                                            <cc1:ModalPopupExtender ID="mpeTeachers" runat="server" 
                                                                 TargetControlID="btnTeachers2" PopupControlID="panelTeachers" 
                                                                 BackgroundCssClass="modalback" CacheDynamicResults="True">
                                                            </cc1:ModalPopupExtender>
                                                            <asp:Button ID="btnStudentsSelect2" runat="server" Text="" style="display:none;"/>
                                                            <cc1:ModalPopupExtender ID="mpeStudents" runat="server" 
                                                                 TargetControlID="btnStudentsSelect2" PopupControlID="panelStudents" 
                                                                 BackgroundCssClass="modalback" CacheDynamicResults="True">
                                                            </cc1:ModalPopupExtender>
                                                            <asp:Button ID="btnUserSelect2" runat="server" Text="" style="display:none;"/>
                                                            <cc1:ModalPopupExtender ID="mpeUsers" runat="server" 
                                                                 TargetControlID="btnUserSelect2" PopupControlID="panelUsers" 
                                                                 BackgroundCssClass="modalback" CacheDynamicResults="True">
                                                            </cc1:ModalPopupExtender>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="left" valign="top">
                                                            <asp:Label ID="Label3" runat="server" Text="عنوان پیام :"></asp:Label>    
                                                        </td>
                                                        <td align="right" valign="top" colspan="2">
                                                            <asp:TextBox ID="tbSubject" runat="server" Width="250px" Font-Names="Tahoma" BackColor="White" Font-Size="8pt"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="left" valign="top">
                                                            <asp:Label ID="Label4" runat="server" Text="متن پیام :"></asp:Label>    
                                                        </td>
                                                        <td align="right" valign="top" colspan="2">
                                                            <asp:TextBox ID="tbContext" runat="server" Width="250px" Font-Names="Tahoma" Font-Size="8pt" BackColor="White" TextMode="MultiLine" Height="250px"></asp:TextBox>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </ContentTemplate>
                                        </asp:UpdatePanel>
                                    </div>
                                </td>
                                <td id="Td132" class="panelmarginleft" align="left">
                                </td>
                            </tr>
                            <tr>
                                <td id="Td142" class="panelbottomright" align="right" >
                                </td>
                                <td id="Td152" class="panelbottomrepeat" >
                                </td>
                                <td id="Td162" class="panelbottomleft" align="left";>
                                </td>
                            </tr>
                        </table>
                        <table border="0" cellpadding="0" cellspacing="0" style="width:600px;">
                            <tr>
                                <td colspan="3" style="padding-top:5px;">
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                        <tr>
                                            <td align="center" valign="top">
                                                <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                                                    <ContentTemplate>
                                                        <asp:LinkButton ID="btnOk" runat="server"  Height="25px" style="margin-top : 10px;"
                                                            Width="100px" CssClass="buttons" onclick="btnOk_Click"  >ارسال</asp:LinkButton>
                                                        <div id="divProgressOkButton" style="width:40px; height:40px; vertical-align:middle; text-align:center;">
                                                        <asp:UpdateProgress ID="UpdateProgressOkButton" runat="server" AssociatedUpdatePanelID="UpdatePanel2">
                                                            <ProgressTemplate>
                                                                <asp:Image ID="Image3" runat="server" ImageUrl="~/images/loading1.gif" Width="40px" Height="40px"/>
                                                            </ProgressTemplate>
                                                        </asp:UpdateProgress>
                                                        </div>
                                                        <asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>
                                                    </ContentTemplate>
                                                </asp:UpdatePanel> 
                                            </td>
                                            <td align="left" valign="top" width="70px">
                                                <asp:LinkButton ID="btnBack" runat="server"  Height="35px" style="position:relative; top: 0px; right: 0px;"
                                                    Width="70px" CssClass="backbutton" onclick="btnBack_Click"></asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                    
                                </td>
                            </tr>
                        </table>
                    </div>
                    <asp:Panel ID="panelManagers" runat="server" BorderStyle="Solid" Width="600px" BorderColor="Khaki" BorderWidth="2px" style="padding:10px 10px 10px 10px; background-color:rgb(0,0,0)">
                        <asp:UpdatePanel ID="upRecs" runat="server">
                            <ContentTemplate> <!-- PANEL COURSES CONTENT : !-->
                                <asp:SqlDataSource ID="SqlManagers" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:ASPNETDB_ConnectionString %>"
                                    ProviderName="System.Data.SqlClient" 
                                    SelectCommand="SELECT * FROM [t_Managers] ORDER BY [managerId]"></asp:SqlDataSource>
                                <div style="font-family:Tahoma; font-size:8pt; text-align:right; color:White;"><asp:Label ID="lblManagersTitle" runat="server" Text=""></asp:Label></div>
                                <div style="margin-top : 10px;">
                                    <asp:GridView ID="GridManagers" runat="server" style="width:100%;" 
                                        AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
                                        DataSourceID="SqlManagers" CssClass="grid" 
                                        PagerStyle-CssClass="gridPager" onrowcommand="GridClasses_RowCommand" 
                                        DataKeyNames="managerId" >
                                        <Columns>
                                            <asp:BoundField DataField="managerId" HeaderText="کد مدیر" InsertVisible="False" ReadOnly="True" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell"/>
                                            <asp:TemplateField HeaderText="نام و نام خانوادگی" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="btnSelect" style="text-decoration:none;" CommandName="ManagerSelect" CommandArgument='<%#Eval("managerId") %>' runat="server"><%#Eval("fullName") %></asp:LinkButton>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="gender" HeaderText="جنسیت" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell"/>
                                            <asp:BoundField DataField="userName" HeaderText="نام کاربری" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell"/>
                                        </Columns>
                                        <PagerStyle CssClass="gridPager" />
                                    </asp:GridView>
                                </div>
                                <div style="text-align:left; padding-top:5px; font-family:Tahoma; font-size:8pt; color:White;">
                                    <table border="0" cellpadding="0" cellspacing="5px" width="100%">
                                        <tr>
                                            <td align="left" valign="middle" width="100%">
                                                <asp:LinkButton ID="btnStudentsCancel" runat="server" CssClass="gridsmallbuttons" 
                                                    Width="60px" Height="20px" style="margin-top:4px;" 
                                                    onclick="btnStudentsCancel_Click" >انصراف</asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                             </ContentTemplate>
                        </asp:UpdatePanel>
                    </asp:Panel>
                    <asp:Panel ID="panelAdmins" runat="server" BorderStyle="Solid" Width="600px" BorderColor="Khaki" BorderWidth="2px" style="padding:10px 10px 10px 10px; background-color:rgb(0,0,0)">
                        <asp:UpdatePanel ID="upAdmins" runat="server">
                            <ContentTemplate> <!-- PANEL COURSES CONTENT : !-->
                                <asp:SqlDataSource ID="sqlAdmins" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:ASPNETDB_ConnectionString %>"
                                    ProviderName="System.Data.SqlClient" 
                                    SelectCommand="SELECT * FROM [t_Admins] ORDER BY [adminId]"></asp:SqlDataSource>
                                <div style="font-family:Tahoma; font-size:8pt; text-align:right; color:White;"><asp:Label ID="lblAdminsTitle" runat="server" Text=""></asp:Label></div>
                                <div style="margin-top : 10px;">
                                    <asp:GridView ID="GridAdmins" runat="server" style="width:100%;" 
                                        AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
                                        DataSourceID="sqlAdmins" CssClass="grid" 
                                        PagerStyle-CssClass="gridPager" DataKeyNames="adminId" 
                                        onrowcommand="GridAdmins_RowCommand" >
                                        <Columns>
                                            <asp:BoundField DataField="adminId" HeaderText="کد کارمند" InsertVisible="False" ReadOnly="True" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell"/>
                                            <asp:TemplateField HeaderText="نام و نام خانوادگی" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="btnSelect" style="text-decoration:none;" CommandName="AdminSelect" CommandArgument='<%#Eval("adminId") %>' runat="server"><%#Eval("fullName") %></asp:LinkButton>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="gender" HeaderText="جنسیت" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell"/>
                                            <asp:BoundField DataField="adminPost" HeaderText="مسئولیت در آموزشگاه" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell"/>
                                            <asp:BoundField DataField="userName" HeaderText="نام کاربری" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell"/>
                                        </Columns>
                                        <PagerStyle CssClass="gridPager" />
                                    </asp:GridView>
                                </div>
                                <div style="text-align:left; padding-top:5px; font-family:Tahoma; font-size:8pt; color:White;">
                                    <table border="0" cellpadding="0" cellspacing="5px" width="100%">
                                        <tr>
                                            <td align="left" valign="middle" width="100%">
                                                <asp:LinkButton ID="LinkButton1" runat="server" CssClass="gridsmallbuttons" 
                                                    Width="60px" Height="20px" style="margin-top:4px;" 
                                                    onclick="LinkButton1_Click" >انصراف</asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                             </ContentTemplate>
                        </asp:UpdatePanel>
                    </asp:Panel>
                    <asp:Panel ID="panelTeachers" runat="server" BorderStyle="Solid" Width="600px" BorderColor="Khaki" BorderWidth="2px" style="padding:10px 10px 10px 10px; background-color:rgb(0,0,0)">
                        <asp:UpdatePanel ID="upTeachers" runat="server">
                            <ContentTemplate> <!-- PANEL COURSES CONTENT : !-->
                                <asp:SqlDataSource ID="sqlTeachers" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:ASPNETDB_ConnectionString %>"
                                    ProviderName="System.Data.SqlClient" 
                                    SelectCommand="SELECT * FROM [t_Teachers] ORDER BY [teacherId]"></asp:SqlDataSource>
                                <div style="font-family:Tahoma; font-size:8pt; text-align:right; color:White;"><asp:Label ID="lblTeachersTitle" runat="server" Text=""></asp:Label></div>
                                <div style="margin-top : 10px;">
                                    <asp:GridView ID="GridTeachers" runat="server" style="width:100%;" 
                                        AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
                                        DataSourceID="sqlTeachers" CssClass="grid" 
                                        PagerStyle-CssClass="gridPager" DataKeyNames="teacherId" 
                                        onrowcommand="GridTeachers_RowCommand" >
                                        <Columns>
                                            <asp:BoundField DataField="teacherId" HeaderText="کد مدرس" InsertVisible="False" ReadOnly="True" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell"/>
                                            <asp:TemplateField HeaderText="نام و نام خانوادگی" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="btnSelect" style="text-decoration:none;" CommandName="TeacherSelect" CommandArgument='<%#Eval("teacherId") %>' runat="server"><%#Eval("fullName") %></asp:LinkButton>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="gender" HeaderText="جنسیت" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell" />
                                            <asp:BoundField DataField="userName" HeaderText="نام کاربری" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell"/>
                                        </Columns>
                                        <PagerStyle CssClass="gridPager" />
                                    </asp:GridView>
                                </div>
                                <div style="text-align:left; padding-top:5px; font-family:Tahoma; font-size:8pt; color:White;">
                                    <table border="0" cellpadding="0" cellspacing="5px" width="100%">
                                        <tr>
                                            <td align="left" valign="middle" width="100%">
                                                <asp:LinkButton ID="LinkButton2" runat="server" CssClass="gridsmallbuttons" 
                                                    Width="60px" Height="20px" style="margin-top:4px;" 
                                                    onclick="LinkButton2_Click" >انصراف</asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                             </ContentTemplate>
                        </asp:UpdatePanel>
                    </asp:Panel>
                    <asp:Panel ID="panelStudents" runat="server" BorderStyle="Solid" Width="600px" 
                         BorderColor="Khaki" BorderWidth="2px" 
                         style="padding:10px 10px 10px 10px; background-color:rgb(0,0,0)" 
                         onload="panelStudents_Load">
                        <asp:UpdatePanel ID="upStudents" runat="server">
                            <ContentTemplate> <!-- PANEL COURSES CONTENT : !-->
                                <asp:SqlDataSource ID="sqlStudents" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:ASPNETDB_ConnectionString %>"
                                    ProviderName="System.Data.SqlClient" 
                                    
                                    SelectCommand='<%#FindSqlSelectCommand() %>'></asp:SqlDataSource>
                                <div style="font-family:Tahoma; font-size:8pt; text-align:right; color:White;"><asp:Label ID="lblStudentsTitle" runat="server" Text='<%#FindSqlSelectCommand() %>'></asp:Label></div>
                                <div style="margin-top : 10px;">
                                    <asp:GridView ID="GridStudents" runat="server" style="width:100%;" 
                                        AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
                                        DataSourceID="sqlStudents" CssClass="grid" 
                                        PagerStyle-CssClass="gridPager" DataKeyNames="studentId" 
                                        onrowcommand="GridStudents_RowCommand"  >
                                        <Columns>
                                            <asp:BoundField DataField="studentId" HeaderText="کد دانشجو" 
                                                InsertVisible="False" ReadOnly="True" HeaderStyle-CssClass="gridHeader" 
                                                ItemStyle-CssClass="gridCell">
                                                <HeaderStyle CssClass="gridHeader" />
                                                <ItemStyle CssClass="gridCell" />
                                            </asp:BoundField>
                                            <asp:TemplateField HeaderText="نام و نام خانوادگی" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell" >
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="btnSelect" style="text-decoration:none;" CommandName="StudentSelect" CommandArgument='<%#Eval("studentId") %>' runat="server"><%#Eval("fullName") %></asp:LinkButton>
                                                </ItemTemplate>
                                                <HeaderStyle CssClass="gridHeader" />
                                                <ItemStyle CssClass="gridCell" />
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="gender" HeaderText="جنسیت" 
                                                HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell">
                                                <HeaderStyle CssClass="gridHeader" />
                                                <ItemStyle CssClass="gridCell" />
                                            </asp:BoundField>
                                            <asp:BoundField DataField="userName" HeaderText="نام کاربری"  
                                                HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell">
                                                <HeaderStyle CssClass="gridHeader" />
                                                <ItemStyle CssClass="gridCell" />
                                            </asp:BoundField>
                                        </Columns>
                                        <PagerStyle CssClass="gridPager" />
                                    </asp:GridView>
                                </div>
                                <div style="text-align:left; padding-top:5px; font-family:Tahoma; font-size:8pt; color:White;">
                                    <table border="0" cellpadding="0" cellspacing="5px" width="100%">
                                        <tr>
                                            <td align="left" valign="middle" width="100%">
                                                <asp:LinkButton ID="LinkButton3" runat="server" CssClass="gridsmallbuttons" 
                                                    Width="60px" Height="20px" style="margin-top:4px;" 
                                                    onclick="LinkButton3_Click" >انصراف</asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                             </ContentTemplate>
                        </asp:UpdatePanel>
                    </asp:Panel>
                    <asp:Panel ID="panelUsers" runat="server" BorderStyle="Solid" Width="600px" BorderColor="Khaki" BorderWidth="2px" style="padding:10px 10px 10px 10px; background-color:rgb(0,0,0)">
                        <asp:UpdatePanel ID="upUsers" runat="server">
                            <ContentTemplate> <!-- PANEL COURSES CONTENT : !-->
                                <asp:SqlDataSource ID="sqlUsers" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:ASPNETDB_ConnectionString %>"
                                    ProviderName="System.Data.SqlClient" 
                                    SelectCommand="SELECT * FROM [t_Users] ORDER BY [userId]"></asp:SqlDataSource>
                                <div style="font-family:Tahoma; font-size:8pt; text-align:right; color:White;"><asp:Label ID="lblUsersTitle" runat="server" Text=""></asp:Label></div>
                                <div style="margin-top : 10px;">
                                    <asp:GridView ID="GridUsers" runat="server" style="width:100%;" 
                                        AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" 
                                        DataSourceID="sqlUsers" CssClass="grid" 
                                        PagerStyle-CssClass="gridPager" DataKeyNames="userId" 
                                        onrowcommand="GridUsers_RowCommand"  >
                                        <Columns>
                                            <asp:BoundField DataField="userId" HeaderText="کد کاربر" InsertVisible="False" ReadOnly="True" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell"/>
                                            <asp:TemplateField HeaderText="نام و نام خانوادگی" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell" >
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="btnSelect" style="text-decoration:none;" CommandName="UserSelect" CommandArgument='<%#Eval("userId") %>' runat="server"><%#Eval("fullName") %></asp:LinkButton>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:BoundField DataField="gender" HeaderText="جنسیت" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell"/>
                                            <asp:BoundField DataField="userName" HeaderText="نام کاربری" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridCell" />
                                        </Columns>
                                        <PagerStyle CssClass="gridPager" />
                                    </asp:GridView>
                                </div>
                                <div style="text-align:left; padding-top:5px; font-family:Tahoma; font-size:8pt; color:White;">
                                    <table border="0" cellpadding="0" cellspacing="5px" width="100%">
                                        <tr>
                                            <td align="left" valign="middle" width="100%">
                                                <asp:LinkButton ID="LinkButton4" runat="server" CssClass="gridsmallbuttons" 
                                                    Width="60px" Height="20px" style="margin-top:4px;" 
                                                    onclick="LinkButton4_Click" >انصراف</asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                             </ContentTemplate>
                        </asp:UpdatePanel>
                    </asp:Panel>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>

