I have a repeater which displays the result of a recordset and a function which determins whether to display web or email link. It works but the function is not being repeated properly, the first record is being repeated for all results.....any help would be appreciated on how to overcome this....
I have the following function at the top of my page:
<%
strEmail = GetListings.Fields.Item("Email").Value
strWWW = GetListings.Fields.Item("WWW").Value
%>
<%
Function GetContactDetails( _
ByVal strEmail, _
ByVal strWWW _
)
If isNull(strWWW) then
If not isNull(strEmail) then
GetContactDetails = "<a href=""mailto:" & strEmail & "?subject=" & "Enquiry"">Email Us</a>"
Else
GetContactDetails = ""
End If
Else
If not isNull(strWWW) then
GetContactDetails = "<a href=""http://" & strWWW & """ target=" & "_blank"">Visit Us</a>"
End If
End If
End Function
%>
and then in the html I have a repeater:
<%
While ((Repeat1__numRows <> 0) AND (NOT GetListings.EOF))
%>
<tr>
<td valign="top"><strong><%=(GetListings.Fields.Item(" BusinessName").Value)%></strong><br />
<%=(GetListings.Fields.Item("Address1").Value)%><% =(GetListings.Fields.Item("Address2").Value)%><br /> <%=(GetListings.Fields.Item("SubPost").Value)%>< br /> </td>
<td valign="top"><%=(GetListings.Fields.Item("Phone"). Value)%></td>
<td valign="top"><%=(GetListings.Fields.Item("Fax").Va lue)%></td>
<td valign="top"><%=GetContactDetails(strEmail, strWWW)%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
GetListings.MoveNext()
Wend
%>
************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...