Hi,
I am creating a dynamic table and would like to display a hyperlink depending on whether or not there is a value in the database.
This is the code I have:
<table border="1" bordercolor="#417A98" width="350" align="center">
<% while ((Repeat1__numRows-- != 0) && (!Rset.EOF)) { %>
<tr>
<td><%=(Rset.Fields.Item("Authors"
.Value)%> </td>
<td><%=(Rset.Fields.Item("Title"
.Value)%> </td>
<td>
<%
if ((TableRecordset.Fields.Item("Link"
.Value) != ""
{
response.write("<a href="
;
%>
<%=(TableRecordset.Fields.Item("Link"
.Value)%>
<%
response.write(" target=_blank>View PDF doc</a>"
;
}
else
{
response.write(" "
;
}
%>
</td>
</tr>
<%
Repeat1__index++;
TableRecordset.MoveNext();
}
%>
</table>
I would like to display "View PDF doc" as text for the hyperlink if Item("Link"
.Value has a value. If it has no value, nothing should be displayed. The problem is that I am getting a runtime error - response is undefined. How can I solve this? I appreciate any suggestions. Thanks.
Anoop.
I am creating a dynamic table and would like to display a hyperlink depending on whether or not there is a value in the database.
This is the code I have:
<table border="1" bordercolor="#417A98" width="350" align="center">
<% while ((Repeat1__numRows-- != 0) && (!Rset.EOF)) { %>
<tr>
<td><%=(Rset.Fields.Item("Authors"
<td><%=(Rset.Fields.Item("Title"
<td>
<%
if ((TableRecordset.Fields.Item("Link"
{
response.write("<a href="
%>
<%=(TableRecordset.Fields.Item("Link"
<%
response.write(" target=_blank>View PDF doc</a>"
}
else
{
response.write(" "
}
%>
</td>
</tr>
<%
Repeat1__index++;
TableRecordset.MoveNext();
}
%>
</table>
I would like to display "View PDF doc" as text for the hyperlink if Item("Link"
Anoop.