I am trying to show a popup from a grid view. But when I try to run the below code in the website the popup panel is not visible. But when I remove the style for panel(i.e display=none;) then it just shows like a panel and not like a popup. In a button click of the link button in the grid view I am trying to show a popup. Help me...
<asp:UpdatePanel runat="server" ID="up1">
<ContentTemplate>
<asp:GridView ID="minidata" CssClass="table" runat="server" AutoGenerateColumns="false" DataKeyNames="abstract">
<Columns>
<asp:BoundField DataField="pid" HeaderText="MyFileId" />
<asp:BoundField DataField="video" HeaderText="MyFileurl" />
<asp:TemplateField HeaderText="abstract">
<ItemTemplate>
<asp:LinkButton ID="lnkDownload" runat="server" Text="Download" OnClick="lnkDownload_Click"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:Panel runat="server" ID="panel1" Height="200px" Width="300px" BorderStyle="Solid" BorderWidth="2px" style="display:none;">
<div>
<table>
<tr>
<td>
<asp:Label runat="server" Text="sacca"></asp:Label>
</td>
<td>
<asp:TextBox ID="emails" runat="server"></asp:TextBox>
</td>
<td>
<asp:LinkButton runat="server">5e76d</asp:LinkButton>
</td>
</tr>
</table>
</div>
</asp:Panel>
<asp:ModalPopupExtender ID="ModalPopupExtender1" PopupControlID="panel1" TargetControlID="Button1" runat="server"></asp:ModalPopupExtender>
<asp:Button ID="Button1" Style="display: none;" runat="server" Text="Button" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="minidata" />
</Triggers>
</asp:UpdatePanel>
In the .cs file
LinkButton lnkbtn = sender as LinkButton;
GridViewRow gvrow = lnkbtn.NamingContainer as GridViewRow;
string filePath = minidata.DataKeys[gvrow.RowIndex].Value.ToString();
HiddenField1.Value = filePath;
emails.Text = "myemail";
this.ModalPopupExtender1.Show();
And when I inspect the website I cannot found the panel displayed in the page