Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Sir , i'm working on the web application nd i want to show image in datalist from the folder which is in the C drive. and i've dynamic value from the database only image name. then how can i show that fro that folder.
Posted

HI
If you are working on local machine then you just append the path(C:\\folder) with dynamic data like
ASP.NET
<asp:Image ID="Image3" runat="server"ImageUrl='C:\\barcode<%# Eval("AppNo")+ %>.gif' Width="110px" Height="30px" />

if you are working on server then you have to make the folder virtual directory and then append it on the path like
ASP.NET
<asp:Image ID="Image3" runat="server"ImageUrl='/barcode/<%# Eval("AppNo")+ %>.gif' Width="110px" Height="30px" />


Hope you got it.

Regard
Ehsan
 
Share this answer
 
v2
Comments
suraj93 27-Nov-14 7:22am    
<asp:Image ID="Image3" runat="server"ImageUrl='<%# 'C:\\barcode'+ Eval("AppNo")+'.gif' %>' Width="110px" Height="30px" />
Error:The server tag is not well formed.
Sreekanth Mothukuru 27-Nov-14 7:58am    
Use Server.MapPath to get the appropriate url
[no name] 27-Nov-14 8:12am    
try this as it is
<asp:Image ID="Image3" runat="server"ImageUrl='C:\\barcode<%# Eval("AppNo")+ %>.gif' Width="110px" Height="30px" />
suraj93 28-Nov-14 1:31am    
yes it's working sir thank you so much....
[no name] 28-Nov-14 9:51am    
if It works then please accept answer
Sir I'm using this :<asp:image id="Image3" runat="server" imageurl="<%# " .gif=" %>" width="110px" height="30px" xmlns:asp="#unknown">

Error:The server tag is not well formed.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900