Working with different path in the Request Object in Asp.Net

Hi,

When we are working on an asp.net Application we have to work with various type of Path. These paths are present in the Request Object. Each path has a different meaning and way for representation. Here is a list of different kind of paths used in Asp.net

Application Path – Will return the root path of the application. This is used to get the application path. This can be found in Request Object. By the default the

CurrentExecutionFilePath – used to get the virtual path of the current request. The difference from the FilePath property is that if there is a redirection of the request in the server code (Server.Transfer) then this will return the correct value. For example it might return the value /Vikramlakhotia.com/MyAdm/LogFeed.aspx

FilePath – will provide the Virtual Path of the current request. (See the difference with CurrentExecutionFilePath above.)

Path – Returns the Virtual Path of the current request.

PhysicalPath - Returns the path of the location where the physical file path corresponding to Requested URL. For example C:\inetpub\wwwroot\vikramWeb\default.aspx

PhysicalApplicationPath – Returns the Path of the physical location of the Application Root.

Vikram

P.S. Note we can use the Server.MapPath object to get the Physical path of any virtual path. Server.MapPath takes only Application relative path.


Share this post   Email it |  digg it! |  reddit! |  bookmark it!

Feedback

Posted on 9/14/2007 4:29:02 PM

Your blog is good. which bloggig software you use?

Posted on 9/15/2007 12:41:58 AM

Hi,

I have custom made this one for my use. Thanks for appriciation

Please post your comments:

Name:  
Email (optional): Your email address will not be posted.
URL (optional):
Comments: HTML will be ignored, URLs will be converted to hyperlinks  
Enter the text you see in the box:
 
Copyright © 2006 - 2008 Vikram Lakhotia