Hi Here's my problem: in a page wich should show a clickable url, i can't show the URL itselfs; all i'm able to do is to show an alternate test like "visit". But i'd need to show the url especially because in some records the url is missing, so if i'll manage to fix the problem, the result should be to show the url if available, and to show nothing if not available. Here's the code: <% Option Explicit %> <!--#include file="common.asp" --> <% Dim rsNews 'Database recordset holding the news items Dim rsComments 'Database recordset holding the comments for this news item Dim lngNewsID 'Holds the News item ID number Dim blnComments 'Set to true if comments are allowed for this item 'Read in the ID number of the news item we are looking at the comments of If isNull(Request.QueryString("NewsID")) = True Or isNumeric(Request.QueryString("NewsID")) = False Then Response.Write "default.asp" Else lngNewsID = CLng(Request.QueryString("NewsID")) End If %> <% 'Create recorset object Set rsNews = Server.CreateObject("ADODB.Recordset") 'Initalise the strSQL variable with an SQL statement to query the database by selecting all tables ordered by the decending date strSQL = "SELECT tblNews.* FROM tblNews WHERE tblNews.ID = " & lngNewsID & " ORDER BY ID ASC;" 'Query the database rsNews.Open strSQL, adoCon 'If there are no records then exit for loop If NOT rsNews.EOF Then 'Read in if comments are allowed for this news item blnComments = CBool(rsNews("Comments")) %> working: [COLOR="SeaGreen"]<a target="_blank" href="<% = rsNews("url") %>">- Visit </a>[/COLOR] not working: [COLOR="Red"]<a target="_blank" href="<% = rsNews("url") %>"><% = rsNews("url") %></a>[/COLOR] Code (markup): I'm sure that there must be some way to fix it, but i'm unable to find it out. Please, someone any ideas? (edit: spelling)
I don't know if this would work, but try assigning the rs value to a string and then use the string as the URL in the href. strURL = rsNews("url") <a target="_blank" href="<%=strURL%>"><%=strURL%></a> Don't know why that would make any difference though?
imo best thing would be to build the link then output it <% linkVal = "<a target='_blank' href='" & rsNews("url") & "'> " & rsNews("url") & "</a>" %> <%=linkVal%>