c# - Not able to find the image by Server.MapPath() -


below code using image not coming, have checked path , correct.

system.web.httpcontext.current.server.mappath(@"\images\myapp.png"); 

may know reason this?

try code

string root = system.web.httpcontext.current.server.mappath("~/images"); string rootpath = string.format("{0}\\{1}", root, "myapp.png"); 

add ~ , put bars /


Comments