PDA

View Full Version : Simple question


rico1931
08-05-2008, 04:41 PM
Hi everyone I have a list of items that are called from a record set to be able to be displayed on a webpage. I want to know if there was a trick or a tip so the browser would be smart and not render something that doesn't contain information. For example I have 4 columns in my database and some columns do not contain info in them. I want the browser to skip reading that line of code in DW. So if nothing is in column 3 It would just display Column 1,2,4 skipping 3 because nothing is in it

Here is an example

<ul>
<li><%=(rsProdDetail.Fields.Item("Bullet1").Value%>
<li><%=(rsProdDetail.Fields.Item("Bullet2").Value%>
<li><%=(rsProdDetail.Fields.Item("Bullet3").Value%>
<li><%=(rsProdDetail.Fields.Item("Bullet4").Value%>
<li><%=(rsProdDetail.Fields.Item("Bullet5").Value%>
</ul>


and say Bullet 5 sometimes has info in the database and sometimes doesn't how would you skip Bullet 5.

Sorry for the long question! Thanks for the help in advance

rico1931
08-05-2008, 05:59 PM
you guys this if else statements? but how would you pass each one in a statement?

rico1931
08-05-2008, 06:24 PM
Here is the answer in case anyone was wondering


<ul>
<%
If rsProdDetail.Fields.Item("Bullet1").Value <> "" Then
%>
<li><%=(rsProdDetail.Fields.Item("Bullet1").Value%></li>
<%
End if
If rsProdDetail.Fields.Item("Bullet2").Value <> "" Then
%>
<li><%=(rsProdDetail.Fields.Item("Bullet2").Value%></li>
<%
End if
If rsProdDetail.Fields.Item("Bullet3").Value <> "" Then
%>
<li><%=(rsProdDetail.Fields.Item("Bullet3").Value%></li>
<%
End if
If rsProdDetail.Fields.Item("Bullet4").Value <> "" Then
%>
<li><%=(rsProdDetail.Fields.Item("Bullet4").Value%></li>
<%
End if
If rsProdDetail.Fields.Item("Bullet5").Value <> "" Then
%>
<li><%=(rsProdDetail.Fields.Item("Bullet5").Value%></li>
<%
End if
%>
</ul>