Modal Web Page

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
 
D

Daniel Fisher\(lennybacon\)

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();";
 

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

Top