How to find the application URL
-
How can I find the URL of the IIS application from a ASP.NET page. Is there a method or property I can use? Say I have an URL like this: "http://myserver/somedir/myappdir/somedir/somepage.aspx" In IIS myappdir is set up as the application, and I want to have code in somepage.aspx to return only "http://myserver/somedir/myappdir"
-
How can I find the URL of the IIS application from a ASP.NET page. Is there a method or property I can use? Say I have an URL like this: "http://myserver/somedir/myappdir/somedir/somepage.aspx" In IIS myappdir is set up as the application, and I want to have code in somepage.aspx to return only "http://myserver/somedir/myappdir"
Well, if you are in some .NET control, it would be easy - just call
ResolveUrl("~/")
method (yes, with that "~/") Philip Patrick Web-site: www.stpworks.com "Two beer or not two beer?" Shakesbeer -
Well, if you are in some .NET control, it would be easy - just call
ResolveUrl("~/")
method (yes, with that "~/") Philip Patrick Web-site: www.stpworks.com "Two beer or not two beer?" ShakesbeerHmmm... Trying this from a webpage. (Not from a control)... Not working... Thanks though! :)
-
Hmmm... Trying this from a webpage. (Not from a control)... Not working... Thanks though! :)
Yeah, this function only for control. Anyway, try this:
Request.ApplicationPath
Philip Patrick Web-site: www.stpworks.com "Two beer or not two beer?" Shakesbeer -
Yeah, this function only for control. Anyway, try this:
Request.ApplicationPath
Philip Patrick Web-site: www.stpworks.com "Two beer or not two beer?" ShakesbeerGreat! Thanks! I must've been blind not to see that one...:suss: