tags:

views:

75

answers:

2

Managing url paths can be a real pain in ASP.NET. AbsolutePath vs RelativePath vs etc. drives me crazy. I find that many solutions require the user to edit web.config element to include the correct subfolder path; ex.

Website Root: http://www.domain.com Web.config setting: /

Website Root: http://www.domain.com/blog web.config setting: /blog/

Is there a way to properly handle this without having to make changes to the web.config?

+2  A: 

You could use Request.ApplicationPath. A reference of usage is here.

This way your images folder, for example, will be Request.ApplicationPath + "/images/";

Brettski
+1  A: 

I think Rick's blog entry helps solve some of my problems...

Dscoduc