473,324 Members | 2,456 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

ShowModalDialog

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
Nov 18 '05 #1
2 3442
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

"martin koenig" <gr********@gmx.xxx.net> wrote in message
news:Ou****************@tk2msftngp13.phx.gbl...
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

Nov 18 '05 #2
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

"DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
news:u9**************@tk2msftngp13.phx.gbl...
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

"martin koenig" <gr********@gmx.xxx.net> wrote in message
news:Ou****************@tk2msftngp13.phx.gbl...
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


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Simon Storr | last post by:
Is it possible to make the parent window refresh when a modal dialog is closed? I know I can use window.opener.location.reload(true); for a 'normal' window, but this doesn't work for...
6
by: Scott Lee | last post by:
I am displaying an ASP.Net generated form in a popup opened with window.showModalDialog. The form contains DropDownList controls. The first ddl is populated via databinding to a datatable, has...
4
by: MW de Jager | last post by:
I want to call ShowModalDialog(...) from my C# code in the code behind page of my aspx page. I do not want to link this to a button, since I want to first do some checking myself before I call the...
3
by: needin4mation | last post by:
Hi, I have an asp:button that has a ShowModalDialog script attribute added to it. When the ShowModalDialog opens the user is supposed to select some data which is then sent back to the calling...
2
by: Sarah | last post by:
I am using the javascript showModalDialog function to open a file upload window. The function opens a page which contains a usercontrol housing the file upload stuff. The control works fine when...
3
by: johkar | last post by:
Just want a verification of logic. This seems to work for IE and Firefox, but I wonder if it would be a problematic test in any of the other latest browsers? Is the use of the "window" object...
1
by: John | last post by:
Hi, I'm having a problem opening / downloading csv files when called from a page opened with window.showModalDialog( ). To isolate this problem, I've written 3 files (see below). 1. main.htm...
6
by: David | last post by:
Hi all, I am opening a webform with showModalDialog. This appears to pop-up fine, though I have a problem... Inside the webform is a treeview control. When the treeview is populated, I am...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.