Last post Aug 14, 2017 06:23 AM by Cathy Zou
Aug 12, 2017 08:49 PM|innocent_Developer|LINK
I have a code such as
userimg.ImageUrl = megImagePath + lbluserimage.Text;
in cs file.
megImagePath is already declare
string megImagePath = System.Configuration.ConfigurationManager.AppSettings["MEGImage"].ToString();
in web config
<add key="MEGImage" value="D:\\MEG\\Images\\"/>
- asp image is not displaying on page.
i found link is like below
how do i need to do to display local drive image in aspimage
Aug 12, 2017 09:46 PM|A2H|LINK
You wont be able to display image like that. You need to use HTTPHandler to display images from physical path
You can take a look at this url Displaying images that
are stored outside the Website Root Folder
Aug 13, 2017 06:22 PM|innocent_Developer|LINK
I tried this already. my one is on master page and those code doesnt work for me.
Aug 13, 2017 06:33 PM|PatriceSc|LINK
Rather than "doesn't work" always tell what happens. To be on the safe side files are stored on the server side ? You'll never be able to access client side files this way.
BTW this code uses an empty catch block. Remove that as it would hide a possible exception which is likely the last thing you want.
Aug 14, 2017 06:23 AM|Cathy Zou|LINK
For most - and for good reasons - you have no access to disk outside of your web site's root folder. To enable access to local drives you will have to add access to the user runs your site. However, without good (very good) reason do not!!
You could learn how to Displaying images that are stored outside the Website Root Folder by refer to the following link
Beside, you also could get more information about your problem by referring to the links below: