Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 20th, 2007, 11:26 AM
Authorized User
 
Join Date: Nov 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default Forcing postback on parent page from modal dialog

I have a modal dialog, and need to be able refresh (i.e. force postback on) the parent form while the modal dialog is still open.

Is this possible?

Thanks,
Gary

 
Old February 20th, 2007, 11:30 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You can reload the parent page which will refresh your content, but I don't know about specifically raising the Postback event in the parent page.

To reload you could write this to the client (Javascript): window.opener.location.href='page.aspx';

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429
 
Old February 20th, 2007, 11:42 AM
Authorized User
 
Join Date: Nov 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your reply.

However, when I register the startup script from the modal dialog, I get the following error:-
"window.opener.location is null or is not an object"

Any ideas?

 
Old February 20th, 2007, 11:54 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

As far as I know, the only way this: window.opener.location.href='page.aspx'; will return NULL is if the modal dialog does not actually have an opener window OR if the opener window is closed before that call is made.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429
 
Old February 20th, 2007, 12:00 PM
Authorized User
 
Join Date: Nov 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What I am actually trying to do is cause the parent form execute server side code (c#) while the modal dialog is still open. although the processing works fine, the page does not get refreshed until the dialog is closed and the next postback occurs.

Before I open the dialog, I assign a Session variable with a reference to the calling page. I can then use this reference to call functions/methods etc. in the parent page from within the modal dialog.

For example, one of the functions on the parent form does some processing then shows the results on the screen. However, If this is called from the modal dialog the processing works but the page does not show the results until the dialog is closed and another event on the parent page causes a postback.

Any help would be greatly appreciated.

 
Old February 20th, 2007, 12:15 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

On your parent page, after you have done your processing, have you tried writing window.location.reload() to the client?

Also, Script Callback may be something for you to look into http://msdn.microsoft.com/msdnmag/is...8/CuttingEdge/

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429
 
Old February 20th, 2007, 12:29 PM
Authorized User
 
Join Date: Nov 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The script doesn't get run. It's as if having a modal dialog (rather than non-modal) open prevents the page from reloading.

 
Old February 20th, 2007, 12:36 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Hmmm. This was an oversight on my part so I appologize. This makes sense that your parent page will not execute commands while the modal window is open, its the same thing in Windows Development, if i spawn a modal window, execution on my parent form WILL not resume until I have closed the modal window. This is, of course, by design. I do not know if it is possible to override this behavior to the point where your parent window would refresh.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429
 
Old February 20th, 2007, 12:44 PM
Authorized User
 
Join Date: Nov 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK - thanks anyway






Similar Threads
Thread Thread Starter Forum Replies Last Post
Referencing parent page from modal dialog gp_mk HTML Code Clinic 25 April 19th, 2007 01:28 PM
how to return value from modal dialog ajaypsingh Javascript 2 May 16th, 2006 05:14 AM
Scrolling modal dialog to top gp_mk HTML Code Clinic 3 September 15th, 2004 07:04 AM
Modal dialog window eldanh ASP.NET 1.0 and 1.1 Basics 0 August 10th, 2004 02:07 PM
Forcing a form in the parent's parent to submit Snib Javascript 11 June 22nd, 2004 11:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.