Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

<a href ....> problem

Status
Not open for further replies.

ojf

Instructor
Sep 27, 2000
49
NO
This href works fine:

response.write &quot;<a href=TEST.ASP?userid=1&tempid=2>Click here</a>&quot;
Status line message is:
Shortcut to TEST.ASP?userid=1&tempid=1

But when I use variables then I do not see the parameters:
file=&quot;TEST.ASP&quot;
userid=1
tempid=2
response.write &quot;<a href=&quot; & file & &quot;?userid=&quot; & userid & &quot;&tempid=&quot; & tempid & &quot;>Click here</a>&quot;
This one does not bring with it the parameters in the status field:
Shortcut to TEST.ASP

What's wrong?
ojf
 
the url and querystring need to be enclosed in double quotes also:

response.write &quot;<a href=&quot;&quot;&quot; & file & &quot;?userid=&quot; & userid & &quot;&tempid=&quot; & tempid & &quot;&quot;&quot;>Click here</a>&quot;
 
I've run into similar problems. It's the way you concatenate the string. Try this...

response.write &quot;<a href='&quot; & file & &quot;'?userid='&quot; & userid & &quot;'&tempid='&quot; & tempid & &quot;'>Click here</a>&quot;
 
I found a solution to my problem. The various variables come from a database, and had for some reason a trailing space. So I just trimmed the file variable:

response.write &quot;<a href='&quot; & trim(file) & &quot;'?userid='&quot; & userid & &quot;'&tempid='&quot; & tempid & &quot;'>Click here</a>&quot;

ojf

 
that would do it. congratulations on solving your problem.

*<|:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top