How to close modal dialog from ASP.NET page

P

pTsy

1)There is a simple AS.NET page with only ONE button - "Ok"

2) There is a html page where i call the ASP.NET page described above
and run it in new instance of IE using window.showModalDialog(...)

3) How to close this ModalDialog when user press button OK on the ASP.NET
page

Please, provide sample code
Thanks
 
K

Ken Dopierala Jr.

Hi,

You can either do this:

btnOK.Attributes.Add("onclick", "window.close(); return false;")

Or, if you need to post back to the Modal page before closing it you can do
this:

Response.Write("<script language='javascript'>window.close();</script>")

Remember, when you post back to a Modal page you must put: <BASE
target="_self"> in the <head> section of the HTML on that page. Good luck!
Ken.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top