The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Brainfart? or ASP.NET madness

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Scott Hanselman

Posts: 1031
Nickname: glucopilot
Registered: Aug, 2003

Scott Hanselman is the Chief Architect at Corillian Corporation and the Microsoft RD for Oregon.
Brainfart? or ASP.NET madness Posted: Nov 18, 2003 6:20 PM
Reply to this message Reply

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.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Scott Hanselman
Latest Posts From Scott Hanselman's ComputerZen.com

Advertisement

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/.“

This is the closest I've got:

>return HttpRuntime.AppDomainAppVirtualPath + "/";>

However, this appears to occasionally (read: flaky) return a different path like /web/images/ or /web/someotherpagedirectory. 

What am I missing?

Read: Brainfart? or ASP.NET madness

Topic: Problems With Microsoft's Latest Patches Previous Topic   Next Topic Topic: Martyn Lovell Has a Blog

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use