pistacchio
pistacchio

Reputation: 58963

HttpContext.Current.Request.ApplicationPath resolved as "/" on develop server

to get some images' path server side i use HttpContext.Current.Request.ApplicationPath to build up a correct path.

It works on the production environment, but it gets resolved as "/" on the developement / debug server provided by VS2008.

Upvotes: 2

Views: 4538

Answers (2)

Anton Gogolev
Anton Gogolev

Reputation: 115877

Just use HttpServerUtility.MapPath("~/images"). The "~" denotes application root.

Upvotes: 0

Akash Kava
Akash Kava

Reputation: 39956

You can use

HttpContext.Curent.Server.MapPath("/*****"); <- this will give you correct path..

Upvotes: 1

Related Questions