Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Forcing parent page postback

Reply
Thread Tools

Forcing parent page postback

 
 
Ashish
Guest
Posts: n/a
 
      04-05-2004
Hello All,
This is a bit wierd. I have a main page in my webapp that has toolbar to
carry out some common operations. Also this main page has an iframe that
hosts a page that serves as an introductory page for carrying out common
actions. When a user clicks on the links in the intro page, I want the main
window (i.e. the main page that hosts the iframe) to perform a postback. Any
ideas how this can be accomplished ?
Thanks
Ashish


 
Reply With Quote
 
 
 
 
matt
Guest
Posts: n/a
 
      04-05-2004
you need to use JavaScript :

To postback the form on the "host" page use

top.document.forms[0].submit();

If you want to perform a postback operation passing specific data you
might find that using the __doPostBack JavaScript function will provide
more what you need.

hth

Matt

"Ashish" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hello All,
> This is a bit wierd. I have a main page in my webapp that has toolbar

to
> carry out some common operations. Also this main page has an iframe

that
> hosts a page that serves as an introductory page for carrying out

common
> actions. When a user clicks on the links in the intro page, I want the

main
> window (i.e. the main page that hosts the iframe) to perform a

postback. Any
> ideas how this can be accomplished ?
> Thanks
> Ashish
>
>



 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      04-06-2004
Hi Ashish,

I agree with Matt that you can do this via a javascript code snippet. For
example:
If we can a page which contain a iframe as below:
<iframe id="frmSub" src="inner.aspx" />

then, in the "inner.aspx", we can use the following javascript code to make
the parent(container) page be posted back:

window.parent.document.forms[0].submit();
or
window.parent.document.FormName.submit();

Either is ok. However, one thing should be noticed is that when call such
code to make the parent page be posted back, when the parent page is posted
back and refreshed, the iframe inner page will also be refreshed. Thanks.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      04-08-2004
Hi Ashish,

Have you had a chance to check out the suggestions in my last reply or have
you got any further ideas on this issue? If you have anything unclear or if
there're anything else we can help, please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If a class Child inherits from Parent, how to implementChild.some_method if Parent.some_method() returns Parent instance ? metal Python 8 10-30-2009 10:31 AM
Re: Forcing a parent tag to have at least one child via an XML schema Mukul Gandhi XML 0 10-03-2008 12:53 PM
Forcing a page to postback John Morgan ASP .Net 3 01-22-2007 04:08 PM
Page load of the parent page called twice when a modal dialog is opened from a button click of the user control on the parent page Samy ASP .Net 2 08-15-2005 03:30 PM
Forcing Page Postback at END of event (while retaining viewstate) Earl Teigrob ASP .Net 0 08-11-2003 04:24 PM



Advertisments