Repeater Control not recognise Image path [Resolved]

Posted by Pkanwar under ASP.NET on 5/23/2013 | Points: 10 | Views : 5112 | Status : [Member] | Replies : 2
hi
<asp:Image ID="Image1" runat="server" Height="112px" Width="88px" ImageUrl='<%# "/Images/" + Eval("ImageUrl") + ".jpg" %>' />
We have a folder Images which contain images, and this images name saved in ImageUrl column name in database.
But in repeater control, not showing Images.
Please help.




Thanks




Responses

Posted by: Rimi1289 on: 5/25/2013 [Member] Starter | Points: 50

Up
0
Down

Resolved
Try this example instead. It will directly extract the file from the folder, irrespective of any type of file.

http://www.encodedna.com/2013/02/repeater-control-in-aspdotnet.htm


Pkanwar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raj.Trivedi on: 5/23/2013 [Member] [MVP] Starter | Points: 25

Up
0
Down
Hello PKanwar

I would suggest to store the path in database as

~/Images/Image.jpg

and just bind the column name in eval

The syntax that you are using will not work

Regard's
Raj.Trivedi
"Sharing is Caring"
Please mark as answer if your Query is resolved

Pkanwar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response