Iframe Src change on form loading

N

Namshub

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
 
G

Guest

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
 
E

Edwin Knoppert

Ok, side-effect it that you'll need a round-trip.
handy to know this asp.net trick as well.


Peter Bromberg said:
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 said:
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
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top