Close ModalDialog form after saving data

  • Thread starter Thread starter laks
  • Start date Start date
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.
 
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
 
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
 
Back
Top