Hi there,
I would like to disable a link based on the database value (ASP page). Does anyone know how to do this? Are there any example available? Need your help. Thanks.
Hi there,
I would like to disable a link based on the database value (ASP page). Does anyone know how to do this? Are there any example available? Need your help. Thanks.
This is a pretty vague question but in Classic ASP you can use VBScript to test your database value and then Response.Write out either the anchor tag or just a span tag with the text:
<%
If CBool(rs("showlink")) = True Then
%>
<a href="somewhere.asp">Link Text</a>
<%
Else
%>
<span>Link Text</span>
<%
End If
%>
This assumes that you are getting a recordset back from the database (named rs) and that it has a field on it called "showlink" that will indicate if the anchor tag should be displayed or not. Small side note: Keep in mind that showing or hiding the anchor tag is not a replacement for proper authentication/security.