Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

controlling iframes 1

Status
Not open for further replies.

seantuk

Programmer
Joined
Mar 22, 2005
Messages
62
Location
GB
i have an iframe that looks a little like this:

Code:
<iframe id="canvas" src="[URL unfurl="true"]http://www.google.co.uk"[/URL] width=\"820\" frameborder=\"0\" height=\"460\" scrolling=\"auto\"/>"

how can i change its 'src' from the page's c# codebehind? in other words, how can iderect it somewhere else?
 
Your ASPX page:
<asp:Literal id="Literal1" runat="server"></asp:Literal>

In Your page load or what ever event you like:

Literal1.Text=@"<iframe id=canvas src=' width=820 frameborder=0 height=460 scrolling=auto />";
 
that's great thanks.

for anyone reading this who now wants to go away and use a Literal, remember to declare it at the top of your code (wihtin your class)

Code:
protected Literal Literal1;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top