function WindowOperation()
{
if(window.showModalDialog)
{
window.showModalDialog('Hello.aspx?ID=1','Hello','width=500,height=500,status=no,toolbar=yes,location=no,resizable=no,menubar=no,top=10,left=10,ScreenX=10,ScreenY=10,modal=yes');
}
else
{
window.open('Hello.aspx?ID=1','Hello','width=500,height=500,status=no,toolbar=yes,location=no,resizable=no,menubar=no,top=10,left=10,ScreenX=10,ScreenY=10,modal=yes');
}
}
use this javascript to open the modal popup and the following code at the Codebehind page of Hello.aspx (i.e. the modal window page) at Page_Load event.
btnClose.Attributes.Add("onclick","window.close();");
This should work.
With Regards,
Prodipta Mondal.
Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.