?
Solved

Building a dynamic external link in ASP

Posted on 2014-03-10
8
Medium Priority
?
397 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
8 Comments
 
LVL 53

Accepted Solution

by:
Scott Fell,  EE MVE earned 2000 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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 
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
 
LVL 53

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
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…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

765 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