Solved

Building a dynamic external link in ASP

Posted on 2014-03-10
8
361 Views
Last Modified: 2014-03-10
Hi all,

I have a small function which returns a dynamically built href= (Link). However, when I vew the results in the browser it looks different than it ought to ;-)
------------------------------------------------------------------------------------------------------

strURL = "xxxxxxxxxxxxxxxx.com/"
Code_GD_Protocol = "http://www."
strPP_AND_LA_URL = "Privacy-Policy-and-Legal-Advice-es.asp"

ReturnSubFoldersNames(NumSiteID) ... Returns a valid folder name. This has worked for years!


Str_LegalTextBoth = "<a class=""PrivacyPolicyText"" href="""&Code_GD_Protocol&strURL&"webs/"&ReturnSubFoldersNames(NumSiteID)&"/"&strPP_AND_LA_URL&""">"& strBothLegPrivi&" </a>"

View source code and this is what I get:
href="webs/abogados-de-nuevas-tecnologias/Privacy-Policy-and-Legal-Advice-es.asp"

It seems to have stripped everything before the "webs/" bit.

Any ideas?

kind regards

Abiel M de Groot
0
Comment
Question by:Abiel de Groot
  • 6
  • 2
8 Comments
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 39918639
Try using
href=""
not
href="""
Str_LegalTextBoth = "<a class=""PrivacyPolicyText"" href=""&Code_GD_Protocol&strURL&"webs/"&ReturnSubFoldersNames(NumSiteID)&"/"&strPP_AND_LA_URL&"">"& strBothLegPrivi&" </a>"

Open in new window

0
 
LVL 5

Author Comment

by:Abiel de Groot
ID: 39918654
When I do thes:
Response.write(Code_GD_Protocol&strURL&"webs/"&ReturnSubFoldersNames(NumSiteID)&"/"&strPP_AND_LA_URL)

http://www.xxxxxxxxxxxxxxxx.com/webs/abogados-de-nuevas-tecnologias/Privacy-Policy-and-Legal-Advice-es.asp

????
0
 
LVL 5

Author Comment

by:Abiel de Groot
ID: 39918665
No, that turns the variable 'Code_GD_Protocol' into a string.
0
 
LVL 5

Author Comment

by:Abiel de Groot
ID: 39918686
The problem only seems to occur when the link is rendered above root level. At root level the very same code works correctly.

A.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39918839
Are you using a WYSIWYG?
0
 
LVL 5

Author Comment

by:Abiel de Groot
ID: 39918863
No, and certainly not for this bit. I use Dreamweaver for some design but this link has been hard coded.

A
0
 
LVL 5

Author Comment

by:Abiel de Groot
ID: 39918864
Its like the browser is truncating the link.
0
 
LVL 5

Author Comment

by:Abiel de Groot
ID: 39918893
Don't waste yout time. many thanks.

It all had to do with the order in which the routines and included files were called.

really sorry.

A.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now