Re: getting the url of a webpage

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Passing the url up to the server in a hidden input field is the correct
idea. You just need to get it work.

Declare the field as
<input type=hidden runat=server id=inhUrl />

Pass the url there in javascript as
document.getElementById("inhUrl").value=myUrl

and access the value on server side as
inhUrl.Value

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"bushi" <bushras84@xxxxxxxxx> wrote in message
news:1176721477.212351.293120@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Apr 16, 1:12 pm, "Eliyahu Goldin"
<REMOVEALLCAPITALSeEgGoldD...@xxxxxxxxxxxx> wrote:
On server side there is no way how a page in an iframe can know anything
about the parent.

On client side the page in the iframe can use window.parent property to
get
to the containing window and get the url of the document loaded into the
containing window as parent.location.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP
[ASP.NET]http://msmvps.com/blogs/egoldinhttp://usableasp.net

"bushi" <bushra...@xxxxxxxxx> wrote in message

news:1176709335.578556.178570@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx



hi!
i'm designing a web application,basically it have two
pages,"client_browser.apsx" & "adserver.aspx"."client_browser.aspx"
contains an iframe,and in the iframe i have displayed my
"adserver.aspx".now i want to get the URL path of the client browser
on my "adserver.aspx".but the code i have used returns me the URL
path of "adserver.aspx",as it is behind the adserver.aspx.i want to
get the URL path of the any client page displaying my server page
through iframe.any one having idea about it plz guide me.
i'm using asp.NET,C# for implementation:
the code i have used is following:

Uri vpath = HttpContext.Current.Request.UrlReferrer;- Hide quoted
text -

- Show quoted text -

thanks Goldin!!!
it helps me,but its available within javascript,i want
to get it in the code behind file.how i can access it in the aspx.cs
file,i have used a hidden field to store its value.but when i
retreived it in the code behind file,its returning me the null
value.can i use this java script in my aspx.cs file?if yes then how?



.



Relevant Pages

  • Re: getting the url of a webpage
    ... On server side there is no way how a page in an iframe can know anything ... On client side the page in the iframe can use window.parent property to get ... "adserver.aspx".now i want to get the URL path of the client browser ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: What doesnt lend itself to OO?
    ... >> proxy and instructs the server to constuct the real object. ... rather than client code. ... If 'clock' is instantiated in the server, ... > for the server interface at the OOA level. ...
    (comp.object)
  • This is going straight to the pool room
    ... or not the client has privilege to do what they're trying to do, ... The server environment is this: ... 3GL User action Routines that Tier3 will execute on your behalf during the ... Routine Name: USER_INIT ...
    (comp.os.vms)
  • [Full-Disclosure] R: Full-Disclosure Digest, Vol 3, Issue 42
    ... Full-Disclosure Digest, Vol 3, Issue 42 ... SD Server 4.0.70 Directory Traversal Bug ... Arkeia Network Backup Client Remote Access ...
    (Full-Disclosure)
  • Re: What doesnt lend itself to OO?
    ... > rather than client code. ... no way to do that without also touching the object with clock semantics ... will not encapsulate both clock semantics and network semantics. ... The server can do whatever it wants ...
    (comp.object)