PC Review


Reply
Thread Tools Rate Thread

Change the Source of one Iframe from another

 
 
Rob
Guest
Posts: n/a
 
      30th Apr 2009
I know some javascript trick could do this, but I want sth like code-
behind.

I have two iframes and when the user click a button in iframe1, I want
to change the source of iframe2.

For the master page, it is as simple as IFrame2.Attributes["src"]
="mypage.aspx";

But how to do the same thing in IFrame1's Code-behind?
 
Reply With Quote
 
 
 
 
Alberto Poblacion
Guest
Posts: n/a
 
      30th Apr 2009
"Rob" <(E-Mail Removed)> wrote in message
news:31de820c-98ca-485c-948a-(E-Mail Removed)...
>I know some javascript trick could do this, but I want sth like code-
> behind.
>
> I have two iframes and when the user click a button in iframe1, I want
> to change the source of iframe2.
>
> For the master page, it is as simple as IFrame2.Attributes["src"]
> ="mypage.aspx";
>
> But how to do the same thing in IFrame1's Code-behind?



You will need Javascript to do this.
The IFrame1's Code-Behind runs at the server when you submit the Form
inside IFrame1. This will only send back to the browser the content that is
to be loaded inside the IFrame1. The page that contains that IFrame is
unaffected, it does not receive anything from the server, so the src of the
IFrame2 will remain set to its previous value regardless of whatever you
send back from the code-behind of the page loaded inside IFrame1.
On the other hand, the browser does see the container page and both
iframes, and can process changes in any of them, so it may be possible to
achieve the effect that you want by playing around a bit with javascript.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Get address from iFrame reference in page source sbitaxi@gmail.com Microsoft Excel Programming 11 15th Sep 2008 07:48 PM
Ajax UpdatePanel as Source for IFrame jacoberg2 Microsoft ASP .NET 1 29th Jun 2008 03:12 PM
Encoding iframe source =?Utf-8?B?RmFyaWJh?= Microsoft ASP .NET 0 14th Sep 2006 08:41 PM
Handling an IFrame at source code. craigkenisston@hotmail.com Microsoft ASP .NET 3 12th Jun 2005 07:23 PM
iframe source on the fly Tim H Microsoft ASP .NET 1 12th May 2004 02:54 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:01 AM.