R
Ryan Taylor
Hello.
I am writing an ASP.NET C# application. I have made a user control so that I
can reuse some code. However, I need to be able to determine what the
virtual root of the website is, so that I can dynamically generate the
proper links to other pages on the site. Basically, I have the following
site layout. I am developing the site in a virual directory on localhost
before it is deployed to an actual site, so I need the solution to work in
both with localhost and with an actual website.
IE: http://www.mydomain.com/otherpages/otherpage1.aspx should return
http://www.mydomain.com
http://localhost/mydomain/otherpages/otherpage1.aspx should return
http://localhost/mydomain
http://www.mydomain.com or http://localhost/mydomain
- login.aspx
- /scripts/
- jscript1.js
- jscript2.js
- /otherpages/
- otherpage1.aspx
- otherpage2.aspx
- /usercontrols/
- usercontrol1.ascx
- usercontrol2.ascx
How can I get the virtual root from within C#.
-Ryan
I am writing an ASP.NET C# application. I have made a user control so that I
can reuse some code. However, I need to be able to determine what the
virtual root of the website is, so that I can dynamically generate the
proper links to other pages on the site. Basically, I have the following
site layout. I am developing the site in a virual directory on localhost
before it is deployed to an actual site, so I need the solution to work in
both with localhost and with an actual website.
IE: http://www.mydomain.com/otherpages/otherpage1.aspx should return
http://www.mydomain.com
http://localhost/mydomain/otherpages/otherpage1.aspx should return
http://localhost/mydomain
http://www.mydomain.com or http://localhost/mydomain
- login.aspx
- /scripts/
- jscript1.js
- jscript2.js
- /otherpages/
- otherpage1.aspx
- otherpage2.aspx
- /usercontrols/
- usercontrol1.ascx
- usercontrol2.ascx
How can I get the virtual root from within C#.
-Ryan