Difficulty managing URLs

URL management can be a real pain in ASP.NET. AbsolutePath vs RelativePath vs etc. Drives me crazy. I believe many solutions require the user to edit the 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 settings: / blog /

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

0


source to share


2 answers


You can use Request.ApplicationPath. Use link here .



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

+2


source


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



+1


source







All Articles