A
az bij
Hi,
I have a dataset bound to a repeater and want to place some logic in
my ascx file. I want to display an image link if and only if an image
is available.
I have tried without success variations of:
<%#if(DataBinder.Eval(Container.DataItem,"ImageFilename"!="")){%>
<a href="#"><img src=<%#DataBinder.Eval(Container.DataItem,
"ImageFilename")%>/></a>
<%}%>
The above gives: Compiler Error Message: CS1513: } expected
Replacing the last <%}%> with <%#}%> gives: CS1525: Invalid expression
term 'if'
And if I remove the # from the first directive: CS0246: The type or
namespace name 'Container' could not be found
It's driving me mad. Can anyone help please?
Thanks,
Andy
I have a dataset bound to a repeater and want to place some logic in
my ascx file. I want to display an image link if and only if an image
is available.
I have tried without success variations of:
<%#if(DataBinder.Eval(Container.DataItem,"ImageFilename"!="")){%>
<a href="#"><img src=<%#DataBinder.Eval(Container.DataItem,
"ImageFilename")%>/></a>
<%}%>
The above gives: Compiler Error Message: CS1513: } expected
Replacing the last <%}%> with <%#}%> gives: CS1525: Invalid expression
term 'if'
And if I remove the # from the first directive: CS0246: The type or
namespace name 'Container' could not be found
It's driving me mad. Can anyone help please?
Thanks,
Andy