Hello
I'm using the following code to dynamically create a three column table of photographs retrieved from a database.
However, when compiling I am receiving an error to say that the variables count and myMod are not declared. Is this because I am using the variables inside the repeater?
PS You'll see that I'm using a couple if statements to evaluate data from my database. I am using...
to do this. Is that correct?
I'm grateful for any help!
Daniel
I'm using the following code to dynamically create a three column table of photographs retrieved from a database.
However, when compiling I am receiving an error to say that the variables count and myMod are not declared. Is this because I am using the variables inside the repeater?
Code:
<table>
<%
Dim count, myMod As Integer
count = 0
myMod = 0
%>
<asp:Repeater ID="Photoviewer_Display" runat="server" DataSourceID="Photoviewer">
<ItemTemplate>
<%
myMod = count Mod 3
If (myMod = 0) Then Response.Write("<tr>")
If Eval("photoviewerOrientation") = "L" Then
Orientation = " border=0 width=72 height=48 border=0"
Else
Orientation = " border=0 width=48 height=72 border=0"
End If
'Write table data cell here
Response.Write("<td><a href=photodisplay.asp?photoviewerID=" & Eval("photoviewerID") & " target=photodisplay><img src=" & Eval("photoviewerCategory") & "/thumbs/" & Eval("photoviewerURL") & Orientation & " ></a></td>")
If (myMod = 2) Then Response.Write("</tr>")
count = count + 1
%>
</ItemTemplate>
</asp:Repeater>
<%
select case myMod
case 0
Response.Write("<td> </td><td> </td></tr>")
case 1
Response.Write("<td> </td></tr>")
case 2
end select
%>
</table>
PS You'll see that I'm using a couple if statements to evaluate data from my database. I am using...
Code:
If Eval("photoviewerOrientation") = "L" Then
I'm grateful for any help!
Daniel