Closing Modal dialog

T

Tim

I have a page that is opening another page using the showmodaldialog.

In the page being shown there are two asp buttons. When the code
finishes in the click event for either button I want to close the
modal window.

So on the click event of both buttons I put in:
me.registerstartupscript("<script
language='javascript'>window.close();</script>").

The problem is that for some reason when the asp buttons are clicked
the application instead of posting back to the same window opens an
entirely different window. The javascript runs fine and closes the
third window but I can't figure out what is making .net open the third
window.

I saw one posting to this news group where the programmer had the same
issue but it was never resolved. Any help would be greatly
appreciated.

Thanks!
 
K

Ken Kolda

This behavior is by design in IE. The workaround is to put your entire page
within an iframe. You can then post back as expected.

Ken
 
T

Tim anonymous

Ken can you explain a little more. I have been reading into the iframe
and I don't see how this helps me.

What I have is two pages. The first holds the information already in the
database. Via radio buttons and command buttons the user can select to
edit an existing value or enter a new value. Upon click of the edit or
add I am (if edit) validating via java script then popping up a dialog
window to show the value. In that second window there are two buttons
cancel / save. Now with the click event of both of those buttons the
window should close. Now with the iframe are saying to use it instead of
the dialog window or inside of the dialog window? And if inside how to I
force it to post back to the dialog window instead of opening another
window?
Also if you know I would like to know why IE was designed to do this, I
can't figure out for the life of me why this would make sense.

Thank you for your time I really appreciate it.

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
T

Tim anonymous

I figured out how to use the iframe to accomplish this. Thanks Ken.

Still not sure why they developed IE to do that though. I can't think of
a reason why I would want a modal dialog window to post to another page.


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 

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