Open popup by clicking on link button on gridview
hi friends
i have a one problem that is first i fill up the form of student details after
those details will be placed in one gridview with linkbutton as studentid
what is my doubt is if i click that linkbutton on gridview those that button id information is open on popup for update purpose....
why problem is how can i open that popup by clicking on link button
please give me the code for this one please............
one hint:
---------
all the code will be placed inside the div
that code will be like this
<div id="divSimplePopup" class="popup" style="display:none; width: 1024px;">
<asp:UpdatePanel ID="Updatepopup" runat="server">
<ContentTemplate>
<div class="big-strip-top"><span>Add Renewal</span></div>
<div class="big-strip-mid">
<table width="95%" border="0" align="center" cellpadding="4" cellspacing="6">
<tr>
<td align="right">Renewal Option ID :</td>
<td align="left"><span class="t-content">
<asp:RadioButtonList ID="RbtnRenewalOptionId" runat="server" >
</asp:RadioButtonList> </span></td>
</tr>
<tr>
<td align="right">Valid from :</td>
<td align="left" ><span class="t-content">
<asp:TextBox ID="txtValidFrom" runat="server"></asp:TextBox>
</span></td>
</tr>
<tr>
<td align="right" >Valid to :</td>
<td align="left" ><span class="t-content">
<asp:TextBox ID="txtValidTo" runat="server"></asp:TextBox>
</span></td>
</tr>
<tr>
<td width="36%" align="right">Paid Amount :</td>
<td align="left"><span class="t-content">
<asp:TextBox ID="txtPaidAmount" runat="server"></asp:TextBox>
</span></td>
</tr>
<tr>
<td align="right" valign="top">Paid Date :</td>
<td align="left"><span class="t-content">
<asp:TextBox ID="txtPaidDate" runat="server"></asp:TextBox>
</span></td>
</tr>
<tr>
<td align="right"></td>
<td align="left"><span class="t-content">
<asp:ImageButton ID="btnSave" runat ="server" ImageUrl="~/Images/btn_save.JPG"
onclick="btnSave_Click" /><asp:ImageButton ID="btnCancel" runat="server" ImageUrl="~/Images/btn_cancel.jpg" OnClientClick="$('#divSimplePopup').hideModal(); return false;" /></span></td>
</tr>
</table>
</div></ContentTemplate></asp:UpdatePanel></div>
public void lnkRenewalID_Click(object sender, System.EventArgs e)
{
//if (e.CommandName == "Text")
//{
// int id = int.Parse(e.CommandArgument.ToString());
//string tmp = "";
//tmp = "<script language='javascript'>";
//tmp += "window.open(AddRenewal.aspx?RenewalID=" + id + "','width=400,height=320')";
//tmp += "</script>";
//Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "MyScript", tmp);
LinkButton lbRenewalID = (LinkButton)sender;
Session["Renewalid"] = int.Parse(lbRenewalID.CommandArgument);
//ScriptManager.RegisterStartupScript(this.GetType(), "popupView", "switchPopupView('divSimplePopup');", true);
//divSimplePopup.Show();
//int i = int.Parse(Session["Renewalid"].ToString());
DataSet ds = new AddRenewalBF().SelectRenewalDtlForUpdate(int.Parse(Session["Renewalid"].ToString()));
RbtnRenewalOptionId.SelectedValue = ds.Tables[0].Rows[0]["RenewalOptionId"].ToString();
txtValidFrom.Text = ds.Tables[0].Rows[0]["ValidFrom"].ToString();
txtValidTo.Text = ds.Tables[0].Rows[0]["ValidTo"].ToString();
txtPaidAmount.Text = ds.Tables[0].Rows[0]["PaidAmount"].ToString();
txtPaidDate.Text = ds.Tables[0].Rows[0]["PaidDate"].ToString();
}