I want to specify a virtual path of a file but I am not able to do so.
Here is my code:
int Course_Id = 1;
int PortfolioID=1;
int ChandidateID=1;
string filepath = Server.MapPath("~/ePortfolio/PortFolioContent/" + Course_Id + "/Assignments/Exhb_" + item.PortfolioID + "_" + item.ChandidateID + ".jpg");
if(System.IO.File.Exists((filepath)))
{
ViewBag.Thumbnail = filepath;
}
When i use Server.MapPath it is fetching data from some other path:
My original path is:
E:\HOBBYHOMES(E-PORTFOLIO)\HobbyHomesWebApp\ePortfolio\PortFolioContent\1\Assignments
but it is taking this path
E:\HOBBYHOMES(E-PORTFOLIO)\HobbyHomesWebApp\ActivityPostin\Images\ePortfolio\PortFolioContent\1\Assignments\Exhb_1_1.jpg
I m not understanding why this is workin so.Please help me