Re: Getting the application path
- From: "Juan T. Llibre" <nomailreplies@xxxxxxxxxxx>
- Date: Sat, 24 Sep 2005 05:55:33 -0400
Use a relative path beginning with a tilde and a slash :
The tilde ( ~ ) stands for the application's root directory.
"~/login.aspx" will always refer to a login.aspx located in
the application's root, no matter what the domain name is.
You can use the same reference for subdirectories :
"~/subdir/newpage.aspx" refers to a page named "newpage.aspx"
which is located in the "/subdir" subdirectory of your App.
Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"Water Cooler v2" <wtr_clr@xxxxxxxxx> wrote in message
news:1127537123.088740.321980@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> How does one get the root of the ASP.NET application. For instance, my
> application is:
>
> http://localhost/MyApplication/login.aspx
>
> Today, it is on a test server, but when I move it to the production
> server, it would become something like:
>
> http://www.foobar.com/MyApplication/login.aspx
>>>From within one of the pages, how do I get the correct path of the
> application so that I don't have to change hard-coded values everytime.
> I need the entire path and not the relative to the page from which I
> query the path.
>
.
- Follow-Ups:
- Re: Getting the application path
- From: Ben Amada
- Re: Getting the application path
- References:
- Getting the application path
- From: Water Cooler v2
- Getting the application path
- Prev by Date: Re: am i understanding this correctly
- Next by Date: Re: Getting the application path
- Previous by thread: Re: Getting the application path
- Next by thread: Re: Getting the application path
- Index(es):
Relevant Pages
|