, .
<img src="<%= ResolveUrl("~/images/a.png") %>" />
, , .
UPDATE
RouteTable
routes.Add("images", new Route("{*path}", null,
new RouteValueDictionary(new { path = ".*/images/.*"}),
new ImageRouteHandler()));
ImageRouteHandler ImageHandler
public class ImageRouteHandler : IRouteHandler
{
public IHttpHandler GetHttpHandler(RequestContext requestContext)
{
return new ImageHandler();
}
}
public class ImageHandler : IHttpHandler
{
public string PhysicalPath { get; set; }
public ImageHandler(string physicalPath)
{
PhysicalPath = physicalPath;
}
public void ProcessRequest(HttpContext context)
{
context.Response.TransmitFile(PhysicalPath);
}
public bool IsReusable
{
get { return true; }
}
}
. System.Web.StaticFileHandler Reflector , Asp.Net .