Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2006

Tip: Looking for answers? Try searching our database.

Close ModalDialog form after saving data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
laks - 18 Feb 2006 05:58 GMT
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 lakshmi.gade@gmail.com
Thanks in advance.
Kris - 18 Feb 2006 07:56 GMT
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
Eliyahu Goldin - 19 Feb 2006 09:20 GMT
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

> Hi
> I'm opening an aspx page with javascript:
[quoted text clipped - 13 lines]
> Can email directly to my mail id lakshmi.gade@gmail.com
> Thanks in advance.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.