kwilliams
06-03-2004, 11:59 AM
JavaScript = JS
VBScript = VB
Hello,
I've developed some code in the past that used JS to display alternating row colors (cream), but I now need to create the same effect with VB. Here's the JS code:
<%
var Repeat1__numRows = 20;
var Repeat1__index = 0;
rsRecordset_numRows += Repeat1__numRows;
%>
<%
var RecordCounter = 0;
%>
<% while ((Repeat1__numRows-- != 0) && (!Recordset.EOF)) { %>
<tr bgcolor=
<%RecordCounter++;
if (RecordCounter % 2 == 1)
Response.Write("#ffffcc");
%>>
<%
Repeat1__index++;
rsRecordset.MoveNext();
}
%>
...and I want to covert it to VB. This is what I've come up with so far:
<%
RecordCounter = 0
Response.Write "<tr bgcolor=RecordCounter++"
If RecordCounter % 2 = 1 Then
Response.Write("#FFFFCC")
End If
Response.Write ">"
%>
The only problem I'm having relates to where it says:
If RecordCounter % 2 = 1
Does anyone know of the VB equivalent to this JS code for this statement that uses the percent sign "%"? Thanks for any help.
KWilliams
VBScript = VB
Hello,
I've developed some code in the past that used JS to display alternating row colors (cream), but I now need to create the same effect with VB. Here's the JS code:
<%
var Repeat1__numRows = 20;
var Repeat1__index = 0;
rsRecordset_numRows += Repeat1__numRows;
%>
<%
var RecordCounter = 0;
%>
<% while ((Repeat1__numRows-- != 0) && (!Recordset.EOF)) { %>
<tr bgcolor=
<%RecordCounter++;
if (RecordCounter % 2 == 1)
Response.Write("#ffffcc");
%>>
<%
Repeat1__index++;
rsRecordset.MoveNext();
}
%>
...and I want to covert it to VB. This is what I've come up with so far:
<%
RecordCounter = 0
Response.Write "<tr bgcolor=RecordCounter++"
If RecordCounter % 2 = 1 Then
Response.Write("#FFFFCC")
End If
Response.Write ">"
%>
The only problem I'm having relates to where it says:
If RecordCounter % 2 = 1
Does anyone know of the VB equivalent to this JS code for this statement that uses the percent sign "%"? Thanks for any help.
KWilliams