monfu
07-08-2004, 09:45 AM
Dear All
I have a problem when displaying images. I wish that when there is no image, ie the field in the database is blank, I do not display any image, since at the moment, it is like displaying a broken link with an x.
Presently, my code is like this:-
<tr class="bodytext">
<%
dim linkImage as string
dim Container As System.Web.UI.Control
linkImage = vwLinks.FieldValue("linkImage", Container)
if linkImage <> "" then
%>
<td>
<span class="image_right">
<img src="images/Links/<%# vwLinks.FieldValue("linkImage", Container) %>"></span>
<span class="bodytext">
<%# vwLinks.FieldValue("linkText", Container) %></span></td>
<%
end if
%>
</tr>
However this code :-
linkImage = vwLinks.FieldValue("linkImage", Container)
is not looping cause it needs the # infront
I tried to do it like this:-
linkImage = %> <%# vwLinks.FieldValue("linkImage", Container)%>
but it gave me a syntax error. How can I solve this?
Thanks for your help and time
johann
I have a problem when displaying images. I wish that when there is no image, ie the field in the database is blank, I do not display any image, since at the moment, it is like displaying a broken link with an x.
Presently, my code is like this:-
<tr class="bodytext">
<%
dim linkImage as string
dim Container As System.Web.UI.Control
linkImage = vwLinks.FieldValue("linkImage", Container)
if linkImage <> "" then
%>
<td>
<span class="image_right">
<img src="images/Links/<%# vwLinks.FieldValue("linkImage", Container) %>"></span>
<span class="bodytext">
<%# vwLinks.FieldValue("linkText", Container) %></span></td>
<%
end if
%>
</tr>
However this code :-
linkImage = vwLinks.FieldValue("linkImage", Container)
is not looping cause it needs the # infront
I tried to do it like this:-
linkImage = %> <%# vwLinks.FieldValue("linkImage", Container)%>
but it gave me a syntax error. How can I solve this?
Thanks for your help and time
johann