Forcing parent page postback

A

Ashish

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
 
M

matt

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
 
S

Steven Cheng[MSFT]

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
 
S

Steven Cheng[MSFT]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top