471,591 Members | 1,788 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,591 software developers and data experts.

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
3 2247
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

11 posts views Thread by HolaGoogle | last post: by
5 posts views Thread by Jim Marquardson | last post: by
6 posts views Thread by fniyogi | last post: by
3 posts views Thread by PCgeek | last post: by
3 posts views Thread by whatever0 | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.