Absolute url from relative path

A

Andreas Zita

How do I get the absolute url for a file from c#-code?

I have the path "~/file.aspx" and I want
"http://www.mydomain.xyz/myapp/file.aspx"

Basically I want to get the complete app-path url including the domain from
the current app, but I have only found ways of getting the physical path and
the virtual path ???

/Andreas
 
Joined
Mar 21, 2008
Messages
3
Reaction score
0
try httpcontext

try HttpContext.Current.Request.Url
this will give you the request url and you could append this to the
required file accordingly.

Let me know, if this helps.
Thank you

Bharath
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top