Dscoduc
Dscoduc

Reputation: 7754

Difficulty in managing URL Paths

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?

Upvotes: 0

Views: 235

Answers (2)

Dscoduc
Dscoduc

Reputation: 7754

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

Upvotes: 1

Brettski
Brettski

Reputation: 20091

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

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

Upvotes: 2

Related Questions