Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamically changing the style sheet

Status
Not open for further replies.

Zirak

MIS
Feb 3, 2003
164
US
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=&quot;genColorfl&quot;
end if
if isOdd(i)=false then
c=&quot;genColorfl1&quot;
end if

%>


<tr class= c >
<td width=&quot;200&quot;>   <%=List(&quot;FirstName&quot;)%> </td>
<td width=&quot;150&quot;>   <%=List(&quot;LastName&quot;)%> </td>
<td width=&quot;200&quot; align=&quot;center&quot;> <%=List(&quot;Phone&quot;)%> </td>
<td width=&quot;150&quot; align=&quot;center&quot;> <%=List(&quot;Ext&quot;)%> </td>
<td width=&quot;200&quot; align=&quot;center&quot;> <%=List(&quot;Voicemail&quot;)%> </td>
<td width=&quot;200&quot; align=&quot;center&quot;> <%=List(&quot;CarCellPhone&quot;)%> </td>
<td width=&quot;150&quot; align=&quot;center&quot;> <%=List(&quot;Pager&quot;)%> </td>
<td width=&quot;200&quot;>   <%=List(&quot;Email&quot;)%> </td>
<td width=&quot;200&quot; align=&quot;center&quot;> <%=List(&quot;Fax&quot;)%> </td>


<%List.Movenext
wend

DCon.Close
Set DCon=nothing
%>
</tr>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top