473,326 Members | 2,175 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,326 software developers and data experts.

Close ModalDialog form after saving data

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 la**********@gmail.com
Thanks in advance.

Feb 18 '06 #1
2 2889
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

Feb 18 '06 #2
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

"laks" <la**********@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
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 la**********@gmail.com
Thanks in advance.

Feb 19 '06 #3

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

Similar topics

5
by: Harry J. Smith | last post by:
I have written a Visual Basic program that does a long calculation and writes the results to disk as it runs. If I click the Close button the window closes but the program keeps running. How can I...
3
by: pTsy | last post by:
1)There is a simple AS.NET page with only ONE button - "Ok" 2) There is a html page where i call the ASP.NET page described above and run it in new instance of IE using...
5
by: Mardy | last post by:
Hello I'm trying to use a pop-up to capture some information and then return the user to a datagrid containing the changes made in the pop-up. I have the database update working and the pop-up...
4
by: Mindy | last post by:
I have two questions here: (1) what is the difference of close form and close table? (2) How "Prompt" works I used close form macro in my database. I hope when a user close the form, he/she will...
6
by: praan | last post by:
I am trying to display xml content in a modaldialog window using window.showModalDialog(), but a blank modaldialog window is displayed. can anyone help me with this. Any other way present to...
9
by: Stan B | last post by:
I create a popup window by calling window.showModalDialog Popup window has Ok button with this code attached: === string Script = "<script language=JavaScript>" + "{" + "window.close();" +...
9
JAMBAI
by: JAMBAI | last post by:
Hi, I have a MS Access form,and its recordsource is some search query. When I click the close button (not the X mark) what ever data I typed in the form field are saved into the database. ...
32
by: Andy | last post by:
To further follow up on my last post regarding the docmd.quit vs. Application.quit using access 2007, I noticed that docmd.quit will correctly compact the database (program file) if you have the...
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...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.