• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 186
  • Last Modified:

visited links

I am using an asp page and pulling out data from a database and one of the fields are used as a hyperlink.
My problem is if one of the fields (hyperlinks) has a space between two words it does not show it's visited link color.
It shows the down state and the active color but not the visited color.  But works that are all together as one word they visited
links works fine...only words with spaces between them don't work...is there a fix for this?
Any ideas?
0
chicabow
Asked:
chicabow
  • 5
  • 4
1 Solution
 
mblaseCommented:
I've never heard of a problem like this. Can you post a URL?
0
 
aarieCommented:
I'm not sure this'll solve your problem, but you might want to replace the space with %20

Arjan.
0
 
chicabowAuthor Commented:
I cannot post the site...
It's in an intranet site......

I don't know what else could be the reason for the space issue....

How can I replace the space with a %20 if the words are coming out of a database table?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
mblaseCommented:
In ASP, you'd use string replacement functions. Try this example:

<%

strTest = "This is a test string."

intSpace = InStr(strTest," ")
Do While (intSpace > 0)
      strLength = Len(strTest)
      strTest = Left(strTest,intSpace-1) + "%20" + Right(strTest,strLength-intSpace)
      intSpace = InStr(strTest," ")
Loop

Response.Write(strTest)

%>

Note that you only need to do this in URL strings, not in displayed text.
0
 
mblaseCommented:
Darned HTML linewrapping. By the way,
"Right(strTest,strLength-intSpace)" should all be on one line up there.
0
 
chicabowAuthor Commented:
You know that the data is coming right out of the database for example..
<a href="page.asp?answer="<%=rs("answer")%>"> annser</a>

So once this is clicked on the variable in answer is taken to the next page.
If it has two words in it....there will be no visited link color showing..
I am suppose to put %20 in there...seems like alot of work for something like this...I have to parse it on both pages...cause then on the page.asp...I need to parse that string again to take out the %20.
0
 
mblaseCommented:
Well, you're in luck, I reread my book and found the smarter solution! :-)

Try this:

<a href="page.asp?answer="<%=Server.URLEncode(rs("answer"))%>"> answer</a>

0
 
chicabowAuthor Commented:
mblase...
you want the points?

It worked!
0
 
mblaseCommented:
Yeah, I want the points! :)
0
 
chicabowAuthor Commented:
Thanks
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now