Solved

Building a dynamic external link in ASP

Posted on 2014-03-10
8
358 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Vbscript 8 65
spacing 5 26
Website Home page blank 4 26
Only allow one site in Internet Explorer on XenApp. 9 26
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

707 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

13 Experts available now in Live!

Get 1:1 Help Now