ShowModalDialog

M

martin koenig

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>.

Can you help me with this?

Thanks
Martin
 
D

DalePres

I think it is better to not submit the page from the Dialog window. You
should pass the data to save back to the parent window, and submit the data
from the parent window. You can then send a flag back to the parent, along
with the response, to indicate success. If the save was NOT successful,
then display the dialog window again. If you were successful, skip the
dialog.

Dale
 
E

Eliyahu Goldin

I second Dale. If you save the form, close the dialog and do another post to
the server from the parent window, you can't guarantee the data you save
will get to the server before the another post. That was my problem in the
similar case, and I ended up with passing data back from the dialog to the
parent windows and saving from over there.

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

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top