Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - how to get the src of a iframe

 
Thread Tools Search this Thread
Old 08-08-2005, 05:32 PM   #1
Default how to get the src of a iframe


Dear sir,

I know how to set the src of a iframe, for example, I can use
Dim frame1 As HtmlControl = Page.FindControl("itest")
frame1.Attributes("src") = Me.TextBox1.Text.Trim

However how can I get the current src of a iframe after user clicking
several times on the iframe??? when I try to get the value of frame1.
Attributes("src"), what I get is the original src I set to it.

How can I do this?

regards,

Guoqi Zheng
http://www.ureader.com


guoqi zheng
  Reply With Quote
Old 08-08-2005, 05:47 PM   #2
Bruce Barker
 
Posts: n/a
Default Re: how to get the src of a iframe
this is only known at the client. you could use some ajax approach to notify
the server of a src change.

-- bruce (sqlwork.com)

"guoqi zheng" <> wrote in message
news:. ..
> Dear sir,
>
> I know how to set the src of a iframe, for example, I can use
> Dim frame1 As HtmlControl = Page.FindControl("itest")
> frame1.Attributes("src") = Me.TextBox1.Text.Trim
>
> However how can I get the current src of a iframe after user clicking
> several times on the iframe??? when I try to get the value of frame1.
> Attributes("src"), what I get is the original src I set to it.
>
> How can I do this?
>
> regards,
>
> Guoqi Zheng
> http://www.ureader.com





Bruce Barker
  Reply With Quote
Old 08-08-2005, 05:53 PM   #3
intrader
 
Posts: n/a
Default Re: how to get the src of a iframe
On Mon, 08 Aug 2005 11:32:20 -0500, guoqi zheng wrote:

> Dear sir,
>
> I know how to set the src of a iframe, for example, I can use
> Dim frame1 As HtmlControl = Page.FindControl("itest")
> frame1.Attributes("src") = Me.TextBox1.Text.Trim
>
> However how can I get the current src of a iframe after user clicking
> several times on the iframe??? when I try to get the value of frame1.
> Attributes("src"), what I get is the original src I set to it.
>
> How can I do this?
>
> regards,
>
> Guoqi Zheng
> http://www.ureader.com

Tell me, while user click on the frame, what do you expect src to change?



intrader
  Reply With Quote
Old 08-08-2005, 06:19 PM   #4
guoqi zheng
 
Posts: n/a
Default Re: how to get the src of a iframe
for example, when user on google.com site and clicks "news", I expect src
changes to "http://news.google.com"

any idea?

regards,

Guoqi Zheng
http://www.ureader.com


guoqi zheng
  Reply With Quote
Old 08-09-2006, 05:37 AM   #5
NawazAli
Junior Member
 
Join Date: Aug 2006
Posts: 2
Default Get the source property of IFrame
you need to do a findcontrol to identify the control on the page and typecast it as follows:-

C#
HtmlControl frame1 = (HtmlControl)this.FindControl("frame1");

VB.NET
Dim frame1 As HtmlControl = CType(Me.FindControl("frame1"), HtmlControl)

Note: You can have different name for the Generic Control you define in the code behind, but for ease I keep both the same. The "frame1" referred in Find Control is the ID as declared in the ASPX Page.

Thereafter, you will be able to access the src property as follows:-

C#
frame1.Attributes["src"] = http://megasolutions.net;

VB.NET
frame1.Attributes("src") = http://megasolutions.net


NawazAli
NawazAli is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
print all the contents of the iframe lebohang The Lounge 0 03-04-2009 07:50 AM
how to access iframe from an aspx page eyal1234 Software 1 07-22-2008 10:57 AM
Dynamic Iframes Memory Leak In Internet Explorer cdmsenthil@gmail.com Software 0 03-28-2008 04:11 PM
How to load Two iframe in one aspx page? pratima Software 2 02-02-2008 03:17 AM
IFRAME and Video stunbunny General Help Related Topics 0 12-03-2007 06:26 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46