Hi,
I have an asp page that reads data from a SQL database.
I want to present the data in a table where each row has a diferent color.
I have written the code but for some reason my html code won't accept the variable that is being dynamically changed by the vbscript.
I don't know what I'm doing wrong.
While adding the records to the table, I use a function to determine if the record is even or odd, based on that I change the style sheet for that row, here is the code:
(I'm sure that c gets the write value, but the html <tr> tag won't get that value)
<%
Dim i
i=0
%>
<%
while not List.EOF
%>
<%
i=i+1
dim C
if isOdd(i)=true then
c="genColorfl"
end if
if isOdd(i)=false then
c="genColorfl1"
end if
%>
<tr class= c >
<td width="200"> <%=List("FirstName"
%> </td>
<td width="150"> <%=List("LastName"
%> </td>
<td width="200" align="center"> <%=List("Phone"
%> </td>
<td width="150" align="center"> <%=List("Ext"
%> </td>
<td width="200" align="center"> <%=List("Voicemail"
%> </td>
<td width="200" align="center"> <%=List("CarCellPhone"
%> </td>
<td width="150" align="center"> <%=List("Pager"
%> </td>
<td width="200"> <%=List("Email"
%> </td>
<td width="200" align="center"> <%=List("Fax"
%> </td>
<%List.Movenext
wend
DCon.Close
Set DCon=nothing
%>
</tr>
I have an asp page that reads data from a SQL database.
I want to present the data in a table where each row has a diferent color.
I have written the code but for some reason my html code won't accept the variable that is being dynamically changed by the vbscript.
I don't know what I'm doing wrong.
While adding the records to the table, I use a function to determine if the record is even or odd, based on that I change the style sheet for that row, here is the code:
(I'm sure that c gets the write value, but the html <tr> tag won't get that value)
<%
Dim i
i=0
%>
<%
while not List.EOF
%>
<%
i=i+1
dim C
if isOdd(i)=true then
c="genColorfl"
end if
if isOdd(i)=false then
c="genColorfl1"
end if
%>
<tr class= c >
<td width="200"> <%=List("FirstName"

<td width="150"> <%=List("LastName"

<td width="200" align="center"> <%=List("Phone"

<td width="150" align="center"> <%=List("Ext"

<td width="200" align="center"> <%=List("Voicemail"

<td width="200" align="center"> <%=List("CarCellPhone"

<td width="150" align="center"> <%=List("Pager"

<td width="200"> <%=List("Email"

<td width="200" align="center"> <%=List("Fax"

<%List.Movenext
wend
DCon.Close
Set DCon=nothing
%>
</tr>