I am using ASP image control for image display or HTML image control for that, I want to set the image URL of image that is outside of our web application’s root directory…
On Which way this is Possible???
I am using ASP image control for image display or HTML image control for
Share
You can use Response.WriteFile to serve the image file from a custom handler.
Alternatively you can also achieve this using a custom VirtualPathProvider. This allows you you remap specific paths to alternative streams, whether it’s the database or another location.
If your application is a child application in IIS, and you actually just want to reference a parent image, just use a slash to get back to the root,
/myimage.jpg, or an absolute path to reference a different applicationhttp://www.myotherapp.com/myimage.jpg.