Solved

Building a dynamic external link in ASP

Posted on 2014-03-10
8
389 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

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.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

730 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