473,408 Members | 1,875 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,408 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 3443
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.