![]() |
|
|
|||||||
![]() |
ASP Net - how to get the src of a iframe |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 |
|
|
|
|
#2 |
|
Posts: n/a
|
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 |
|
|
|
#3 |
|
Posts: n/a
|
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 |
|
|
|
#4 |
|
Posts: n/a
|
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 |
|
|
|
#5 |
|
Junior Member
Join Date: Aug 2006
Posts: 2
|
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 |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
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 |