How to change iframe src ?

A

Atilla

<iframe
id="fband"
name="fband"
--> src="band.aspx?S=Other"
width="100%"
height="300"
scrolling="auto"
frameborder="0">
</iframe>

How to change iframe by using VS 2008 C# ?
 
E

Eliyahu Goldin

First of all set for the iframe runat="server".

Then you can get it on server side as
HtmlGenericControl myFrame = this.FindControl("fband") as
HtmlGenericControl;

Then you can set its attributes:
myFrame.Attributes["src"]="...";

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 

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

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top