This post originated from an RSS feed registered with .NET Buzz
by Scott Hanselman.
Original Post: Brainfart? or ASP.NET madness
Feed Title: Scott Hanselman's ComputerZen.com
Feed URL: http://radio-weblogs.com/0106747/rss.xml
Feed Description: Scott Hanselman's ComputerZen.com is a .NET/WebServices/XML Weblog. I offer details of obscurities (internals of ASP.NET, WebServices, XML, etc) and best practices from real world scenarios.
I need a function from ASP.NET that gives me, reliably and guaranteed, without a config
file, the base virtual directory of the current website. So if I'm in c:\inetpub\wwwroot\web
(ne http://localhost/web) then I want “/web/.”
But (here's the fart part) I can't seem to find a way that gives it to me INDEPENDANT
of the current Context's path. Meaning, if the VERY FIRST (app start) page hit
on the site is http://localhost/web/balances/balances.aspx then
I still need “/web/“ not “/web/balances/.“