Virtual Path "~/" to full Uri

  • Thread starter Thread starter Nathan
  • Start date Start date
N

Nathan

I need to take a path "~/" and get a http://localhost:port/rootappfolder/
url out of it.

Currently I'm using:
Request.Url.Scheme + "://" + Request.Url.Host + this.ResolveUrl("~/");
//this is run from the context of a user control.

Is this the best way to do this by rebuilding the url from the client
request?

ideas?

Thanks in advance,
Nathan
 
Assuming that the scheme is always going to be "http://" you don't need to
get that from the Request.

--
HTH,

Kevin Spencer
Microsoft MVP

DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
Yeah, I actually ended up using:
Request.Url.Scheme + "://" + Request.Url.Host + ":" +
Request.Url.Port.ToString() + this.ResolveUrl("~/")

I'm trying to make my app portable between dev and production without having
to worry about the path. It's also being generated in a PDF, so I needed to
be able to have a fully qualified path for the link so it could be accessed
from the client directly.

Thanks
 
Back
Top