Solved

Building a dynamic external link in ASP

Posted on 2014-03-10
8
396 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 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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

726 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