Friday, November 19, 2004

Path - ASP.NET, Windows

Some of the things about Paths in .Net that migh prove usefull..

When using a windows application you can use Application.StartUpPath to get the path of the app.

But while using an ASP.NET application, you can utilize Request.PhysicalApplicationPath to get you the physical path (e.g : c:\inetpub\wwwroot\yourAppName\), whereas Request.FilePath will get you the file path (e.g : "/yourAppName/folderName/pageName.aspx")

SideNote: Use System.IO.Path.Combine to avoid forming invalid paths if you app is started from the root folder of the drive.

P.S : check out this article by Fritz Onion on Understanding Paths in ASP.NET..

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?

© Copyright 2005, Rohan Thomas
This Blog contains findings that are self-explored and expressions that are self-evoked. They are by no meanss representions of my employer's view.