tallpaul
February 17th, 2006, 07:58 AM
I have some classic asp that i am trying to convert to asp.net
I have started using item templates with the following code to call database feilds:<%# DataBinder.Eval(Container.DataItem, "Addressline1") %>
My problem is that i need to have an if then statment. If an image isnt present then load noimage.gif for instance:
<% if rs("CBanner") <> "" then %>
<td width="526" colspan="3" class="tablecells"><img src="images/DirectoryBanners/<%=cbanner%>" width="522"/></td>
<%else%>
<td width="526" colspan="3" class="tablecells"> </td>
<%end if%>
How on earth do i do this with::<%# DataBinder.Eval(Container.DataItem, "Addressline1") %>
or am imissing somthing
Cheers for any help
I have started using item templates with the following code to call database feilds:<%# DataBinder.Eval(Container.DataItem, "Addressline1") %>
My problem is that i need to have an if then statment. If an image isnt present then load noimage.gif for instance:
<% if rs("CBanner") <> "" then %>
<td width="526" colspan="3" class="tablecells"><img src="images/DirectoryBanners/<%=cbanner%>" width="522"/></td>
<%else%>
<td width="526" colspan="3" class="tablecells"> </td>
<%end if%>
How on earth do i do this with::<%# DataBinder.Eval(Container.DataItem, "Addressline1") %>
or am imissing somthing
Cheers for any help