Obtaining an iFrame src in ASP.NET

H

honguin

Hi,

The current scenario is that I have an iframe inside an asp.net web
page where I periodically check the url inside the iFrame. I know that
all this information can be obtained in the client-side during a page
load.
Does anyone know an efficient way to obtain the current url of the src
attribute of the iFrame? Or if there is a better solution?

Many thanks
 
H

honguin

I have tried on the server side, but to no prevail, aand not sure how
to go abouts for the client side.

Are you trying to do this on the client or server side?

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)




The current scenario is that I have an iframe inside an asp.net web
page where I periodically check the url inside the iFrame. I know that
all this information can be obtained in the client-side during a page
load.
Does anyone know an efficient way to obtain the current url of the src
attribute of the iFrame? Or if there is a better solution?
Many thanks- Hide quoted text -

- Show quoted text -
 
N

Nicholas Paldino [.NET/C# MVP]

Well, what exactly are you trying to do? On the client side, you would
use javascript to access it. You just have to know the id of the IFrame
element and you can proceed from there.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

I have tried on the server side, but to no prevail, aand not sure how
to go abouts for the client side.

Are you trying to do this on the client or server side?

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)




The current scenario is that I have an iframe inside an asp.net web
page where I periodically check the url inside the iFrame. I know that
all this information can be obtained in the client-side during a page
load.
Does anyone know an efficient way to obtain the current url of the src
attribute of the iFrame? Or if there is a better solution?
Many thanks- Hide quoted text -

- Show quoted text -
 
H

honguin

Even when you declare a new HtmlControl frame inside a frameholder,
obviously you can set the src attribute to a url. But when you run a
timer, on the HtmlControl object is NULL so there is no way you can
access anything from the server-side.
 
H

honguin

How would you be able to access the src element of the iframe using
javascript and store this in a string in c#?

Well, what exactly are you trying to do? On the client side, you would
use javascript to access it. You just have to know the id of the IFrame
element and you can proceed from there.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)




I have tried on the server side, but to no prevail, aand not sure how
to go abouts for the client side.
Are you trying to do this on the client or server side?
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi,
The current scenario is that I have an iframe inside an asp.net web
page where I periodically check the url inside the iFrame. I know that
all this information can be obtained in the client-side during a page
load.
Does anyone know an efficient way to obtain the current url of the src
attribute of the iFrame? Or if there is a better solution?
Many thanks- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
 
H

honguin

Is there a way of obtaining the URL of the src element when requested,
is there a need for Page.RegisterStartupScript? Because when running a
timer which makes use of a static method, you won't be able to use
Page.RegisterStartupScript which you can run the javascript code?

How would you be able to access the src element of the iframe using
javascript and store this in a string in c#?

Well, what exactly are you trying to do? On the client side, you would
use javascript to access it. You just have to know the id of the IFrame
element and you can proceed from there.
I have tried on the server side, but to no prevail, aand not sure how
to go abouts for the client side.
On Jul 27, 3:48 pm, "Nicholas Paldino [.NET/C# MVP]"
Are you trying to do this on the client or server side?
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi,
The current scenario is that I have an iframe inside an asp.net web
page where I periodically check the url inside the iFrame. I know that
all this information can be obtained in the client-side during a page
load.
Does anyone know an efficient way to obtain the current url of the src
attribute of the iFrame? Or if there is a better solution?
Many thanks- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
 

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

Top