I'm very new to VB.NET so forgive me if this is a really ignorant question...
I am trying to figure out how to set the SRC property of an iFrame tag using VB.NET.
The iFrame is called IFRAME1
Here's the stuff I'm playing with right now, all of this code is in the Page_Load:
ATTEMPT1:
Does not work because the IFRAME1 is "undeclared" according to javascript debugger, this seems to be occuring because the code section is getting run before the page is really loaded. Is there any way to fix this?
sScript &= "<script language='javascript'>"
sScript &= "IFRAME1.location.href='http://www.yahoo.com';"
sScript &= "<" & Chr(Asc("/")) & "script>"
Response.Write(sScript)
ATTEMPT2:
These are just snips that I've found and am trying to modify for use in my situation but none seem too promising.
'("onClick", "javascript:window.IFRAME_NAME.print();")
'Button1.Attributes.Add("onclick", "document.getElementById('frmAdv').src='page2.aspx';return false;")
'IFRAME1.Attributes.Add("src", "targetpage.aspx")
I like this last line the best but it seems that the VB code can't set properties of non ASP tags. Is that correct?
Thanks for any help.
- TomI found a solution:
I put a label on the page called lblIFrame and put the following in Page_Load. "URL" contains the target url.
Me.lblIFrame.Text = "<IFRAME src="http://pics.10026.com/?src="" & URL & """ WIDTH=100% HEIGHT=100% BORDER=0 SCROLLING=YES>"
- T
Thanks for posting this here. I have been looking for this solution for a while now. bravo.
Franklin
0 comments:
Post a Comment