467,077 Members | 974 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,077 developers. It's quick & easy.

Iframe Src change on form loading

I'm trying to create a dynamic link to different sources when a page loads
(I want a set of buttons at the top before the IFrame) but the content of
the IFrame will be dynamic but know when the page is loaded.

How can I either generate the HTML on the fly as the form is loading or set
the Src value of the IFrame tag as the page is loading?

Thanks

Ric
May 30 '06 #1
  • viewed: 2041
Share:
3 Replies
Page:
<form id="Form1" method="post" runat="server">
<iframe id="frm" runat="server"></iframe>
</form>

Codebehind:

protected HtmlGenericControl frm;
private void Page_Load(object sender, System.EventArgs e)
{
frm.Attributes["src"]="http://www.yahoo.com";
}

--Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Namshub" wrote:
I'm trying to create a dynamic link to different sources when a page loads
(I want a set of buttons at the top before the IFrame) but the content of
the IFrame will be dynamic but know when the page is loaded.

How can I either generate the HTML on the fly as the form is loading or set
the Src value of the IFrame tag as the page is loading?

Thanks

Ric

May 30 '06 #2
http://www.hellobasic.com/download/d...einnerhtml.txt

"Namshub" <Ri*************@Southend.nhs.uk.RemoveMyspam> schreef in bericht
news:e0**************@TK2MSFTNGP04.phx.gbl...
I'm trying to create a dynamic link to different sources when a page loads
(I want a set of buttons at the top before the IFrame) but the content of
the IFrame will be dynamic but know when the page is loaded.

How can I either generate the HTML on the fly as the form is loading or
set the Src value of the IFrame tag as the page is loading?

Thanks

Ric

May 30 '06 #3
Ok, side-effect it that you'll need a round-trip.
handy to know this asp.net trick as well.
"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.com> schreef in bericht
news:C6**********************************@microsof t.com...
Page:
<form id="Form1" method="post" runat="server">
<iframe id="frm" runat="server"></iframe>
</form>

Codebehind:

protected HtmlGenericControl frm;
private void Page_Load(object sender, System.EventArgs e)
{
frm.Attributes["src"]="http://www.yahoo.com";
}

--Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Namshub" wrote:
I'm trying to create a dynamic link to different sources when a page
loads
(I want a set of buttons at the top before the IFrame) but the content of
the IFrame will be dynamic but know when the page is loaded.

How can I either generate the HTML on the fly as the form is loading or
set
the Src value of the IFrame tag as the page is loading?

Thanks

Ric

May 30 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

By using this site, you agree to our Privacy Policy and Terms of Use.