开发者

Image Binding in ASP.NET

I have the following piece of code

ImageUrl='<%# Bind("ImageUrl") %>'

I've got a GridView I want to show images on a ItemTemplate I have a Database where I'm saving on the name of the images e.g --> img1.jpg

I want to append the full path of the image at before its name so It can be viewed on the ItemTemplate on the GridView.

I tried to use concat, or the + op开发者_运维问答erator but it doesn't seem to work can any1 tell me what 2 do ???


Use inline Eval like this ImageUrl='<%# "path/to/image" + Bind("ImageUrl") %>'

No need to use Bind. Its used for two-way, read/write databinding.


Hi try this it ll works

' height="120" width="180" alt="" /> ' OnClick="BtnImg_Click" height="120" width="180"/>

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜