I m trying 开发者_开发问答to assign imageurl like this Image1.ImageUrl = @"C:\abc.jpg";
my image is outside the project but it not working. how we can assign image which is outside
the project.Is their any changes in config file for do that?
Asp.net works on IIS. IIS processes user request over HTTP to resolve some content. So when you assign ImageUrl = @"C:\abc.jpg"
IIS cannot resolve this over HTTP spec (at least at security reason, because anybody then could ask file from your computer).
To solve you problem - just create yet another IIS web-application, (that can be mounted at any folder of disk), assuming it is called MyImages.
After it you can reference to ImageUrl = @"http://MyImages/abc.jpg"
The better way is placing images onto Content Delivery Network (CDN) - public servers that shares picture for anybody in fast way
精彩评论