< asp:HiddenField ID="hfHidden" runat="server" /> <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender" runat="server" TargetControlID="hfHidden" PopupControlID="Panel1" BackgroundCssClass="modalBackground" OkControlID="OkButton" >
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" dir="ltr" CellPadding="4" ForeColor="#333333" GridLines="None" onselectedindexchanged="GridView1_SelectedIndexChanged" Width="220px" AllowSorting="True" DataSourceID="SqlDataSource1" Font-Names="B Yekan" DataKeyNames="MessageId" onrowcommand="GridView1_RowCommand" onrowdatabound="GridView1_RowDataBound"> <AlternatingRowStyle BackColor="White" /> <Columns> <asp:TemplateField HeaderText="show"><EditItemTemplate> </EditItemTemplate> <ItemStyle Width="40%" CssClass="Col1" HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle> <ItemTemplate> <asp:LinkButton ID="LinkButton_Subject" runat="server" CommandArgument="<%# Container.DataItemIndex %>" OnClick="LinkButton_Subject_Click" Text="show" CommandName="ViewComments"></asp:LinkButton> <asp:Label ID="Label_MessageID" runat="server" Text='<%# Eval("MessageID") %>' Visible="False"></asp:Label> </ItemTemplate> </asp:TemplateField>
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { switch (e.CommandName) { case "ViewComments": ModalPopupExtender.Show(); break; } } and protected void LinkButton_Subject_Click(object sender, EventArgs e) { ModalPopupExtender.Show(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)