Modal Web Page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I ahve a program that opens another page through modal. When I click on a
button to close the modal page, it just reposts and does not close. I tried
this within the event handler -

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

But is doesn't seem to work.

Any help out there with this?

Thank you
 
The javascript

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

only works inside of the <body> tag.

either you do it this way

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

or you just add the following to the Page_Load

myButton.Attributes["onclick"] = "window.close();";
 
Back
Top