G
Guest
I have a datalist bound to a dataset.
In the Items template I have a Image which was supposed to changed depending
on a certain value retrieved from the dataset.
I have the ImageUrl attribute for the Image which I want to change
ImageUrl='...images\' <%# DataBinder.Eval(Container,
"DataItem.NeedForCover")%>'.BMP'> but it complains: the server tag is not
well formed. All I want to get from the dataset is the string.
How can I make it work ?
Also is there a way to put some kind of condition before an attribute like
we did with ASP f.e:
<%#if DataBinder.Eval(Container, "DataItem.NeedForCover")=True then %>
ImageUrl='...\images\HAPPY.BMP'>
<%# else %>
ImageUrl='...\images\SAD.BMP'>
<%# End if %>
Please help,
Thank everyone.
In the Items template I have a Image which was supposed to changed depending
on a certain value retrieved from the dataset.
I have the ImageUrl attribute for the Image which I want to change
ImageUrl='...images\' <%# DataBinder.Eval(Container,
"DataItem.NeedForCover")%>'.BMP'> but it complains: the server tag is not
well formed. All I want to get from the dataset is the string.
How can I make it work ?
Also is there a way to put some kind of condition before an attribute like
we did with ASP f.e:
<%#if DataBinder.Eval(Container, "DataItem.NeedForCover")=True then %>
ImageUrl='...\images\HAPPY.BMP'>
<%# else %>
ImageUrl='...\images\SAD.BMP'>
<%# End if %>
Please help,
Thank everyone.