HttpRequest.ApplicationPath
returns virtual root path for current application, so shouldn’t in the following example when user requests http://localhost:64390/WebSite2/Default.aspx, lblApplicationPath.Text
return string “/WebSite2”
, since that is the path from web site’s virtual root to WebSite2
application’s virtual root? Instead it returns an empty string
Default.aspx:
<asp:Label ID="lblApplicationPath" runat="server"
Text='<%# HttpContext.Current.Request.ApplicationPath %>'>
</asp:Label>
Similarly an article at http://msdn.microsoft.com/en-us/library/ms178116.aspx states that with browser request to http://www.contoso.com/MyApplication/MyPages/Default.aspx, an ApplicationPath returns /
, but shouldn’t it return /MyApplication
, since that is the path from web site’s virtual root to application’s virtual root?
Thank you