On button click modal popup fails to appear, but the linkbutton works perfectly well.
Please help
<asp:GridView ID="gvDetails" runat="server" AutoGenerateColumns="False"
BackColor="White" BorderColor="#3366CC" BorderStyle="None"
Font-Names="Century Gothic" Font-Size="x-Small" DataKeyNames="id"
Width="100%" Style="margin-bottom: 0px" CssClass="grid">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:HiddenField ID="id" runat="server" Value='<%#Eval("id") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="embid" HeaderText="Emb.Id" />
<asp:BoundField DataField="type" HeaderText="Type" />
<asp:BoundField DataField="circfemale" HeaderText="Emb Cir.Fem" />
<asp:BoundField DataField="circmale" HeaderText="Emb Cir.Male" />
<asp:BoundField DataField="diameter" HeaderText="Diameter" />
<asp:BoundField DataField="artworkdate" HeaderText="Artworkdate" />
<asp:BoundField DataField="supplier" HeaderText="Supplier" />
<asp:BoundField DataField="comment" HeaderText="Comment" />
<asp:BoundField DataField="ppid" HeaderText="Job Used" />
<asp:TemplateField>
<ItemTemplate>
<asp:Button Text="View" ID="Inkview" runat="server" OnClick="Inkview_Click" ForeColor="#FF9900" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton Text="Edit" ID="lnkView1" runat="server" OnClick="Preview1" ForeColor="#FF9900" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
//for get record
protected void Inkview_Click(object sender, EventArgs e)
{
MainView.ActiveViewIndex = 0;
Tab6.CssClass = "Clicked";
gvDetails.UseAccessibleHeader = true;
gvDetails.HeaderRow.TableSection = TableRowSection.TableHeader;
ScriptManager.RegisterStartupScript((sender as Control), this.GetType(), "Popup", "ShowPopup();", true);
int rowIndex = ((sender as LinkButton).NamingContainer as GridViewRow).RowIndex;
int lbl1 = Convert.ToInt32(gvDetails.DataKeys[rowIndex].Values[0]);
SqlConnection con = new SqlConnection("data source=NEW\\SPRESS01; Initial Catalog=Deliver;Integrated Security=True;");
SqlCommand cm = new SqlCommand();
cm.Connection = con;
con.Open();
cm.CommandType = CommandType.Text;
cm.CommandText = "SELECT ppid FROM job_emboss WHERE id=@id ";
cm.Parameters.AddWithValue("@id", lbl1);
TextBox393.Text = Convert.ToString(cm.ExecuteScalar());
con.Close();
}