Close ModalDialog form after saving data

L

laks

Hi
I'm opening an aspx page with javascript:
window.showModalDialog("mypage.aspx", "", "status:no");

In mypage.aspx I've got a button which shall first save the displayed
record
in the C# code behind (this works fine) and if successfull, mypage.aspx

shall be closed (window.close).


Data saving and so on is working fine. My problem is the <... if
successfull, .... shall be closed>.
It is very urgent for me.


Can any one help me with this?
Can email directly to my mail id (e-mail address removed)
Thanks in advance.
 
K

Kris

Hi Laks,

Call window.close(); method after saving the data.

Since it is a javascript function use RegisterClientScriptBlock method
after saving the data.

Hope this would help you.

Cheers,
Kris
 
E

Eliyahu Goldin

You can provide a hidden input element for communicating actions from server
to client. If the server saves the form successfully, it will set the hidden
input value to "CLOSE". The client will get this value in the body's onload
event and call window.close().

Eliyahu
 

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

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top