AddyProg
AddyProg

Reputation: 3050

ASP Image control not Picking up ImageUrl

i have image saved in C: drive of server and my ASP.NET web application is picking them up and showing them in an ASP:Image tag but its not working, i have checked the path a 100 times its very fine. Here is the path of image

C://Temp//image.png

and here is the code inside a girdView templateFiled

 <asp:Image ImageUrl='<%#Eval("Picture") %>' ID="Image1" runat="server" Width="90%" Height="20%" />

Upvotes: 0

Views: 455

Answers (1)

Sam
Sam

Reputation: 2917

Create a folder in your web application and copy the image there. Then refer to it using a relative path.

If you refer to this image in C: drive eventually when you host the application all users of this website will not see the image. Because a web browser cannot access an image in C: drive of the web server.

Upvotes: 3

Related Questions