Step 1: Frist create a div.
<div id="dialog" style="display: none">
<iframe id="showpage" runat="server" height="400" width="650" src=""></iframe>
</div>
<asp:HiddenField ID="hdnPopUp" runat="server" />
</div>
Step 2: Create a Java script function
function showDialog() {
$(function () {
$('#dialog').dialog({
modal: true,
width: 650,
hight: 400,
close: function (event, ui) {
$('#dialog').hide(); document.getElementById('<%=BtnGo.ClientID%>').click();
},
open: function (event, ui) {
$('#dialog').show();
$(this).parent().children().children('.ui-dialog-titlebar-close').hide();
},
buttons: [{
text: "close",
click: function () {
$(this).dialog("close");
}
}
]
});
});
}
Step 3: Here Hidden field work as a Flag.
set the flag/hidden field value as 0 in Page load event.
if (!string.IsNullOrEmpty(hdnPopUp.Value) && hdnPopUp.Value.Equals("1"))
{
hdnPopUp.Value = "0";
}
Step 4: register the page and set the hidden field value 1. means set the status value as 1.
String csname2 = "ViewPopUp";
System.Type cstype2 = this.GetType();
ClientScriptManager cs2 = this.ClientScript;
if (!cs2.IsStartupScriptRegistered(cstype2, csname2))
{
String cstext2 = "showDialog();";
showPrintpage.Attributes.Remove("src");
showPrintpage.Attributes.Add("src", "About.aspx?id=" + 1);
cs2.RegisterStartupScript(cstype2, csname2, cstext2, true);
hdnPopUp.Value = "1";
}