[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Anchor Tags - how to retreive them via Classic ASP

Posted on 2011-09-30
12
Medium Priority
?
401 Views
Last Modified: 2012-05-12
Hi All,

If I have a classic asp script like the following;

DisplayMakes.asp#4532

How do I grab the anchor portion of the page name, i.e. 4532 via my asp script?

Regards

JamWales
0
Comment
Question by:Jamie
[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
12 Comments
 
LVL 11

Expert Comment

by:G_H
ID: 36892894
(UNTESTED)

Maybe something like:

 
ScriptName    = Request.ServerVariables("SCRIPT_NAME")
if InStr(ScriptName, "#") > 0 then
  arrScriptName = Split(ScriptName, "#")
  LastSectionThatYouAreInterestedIn = arrScriptName(UBound(arrScriptName))
else
  '' ## NO HASH
end if

Open in new window


GH
0
 

Author Comment

by:Jamie
ID: 36893095
Hi G_H ,

Thank you for your reply - unfortunately that does't work, as the #4532 does not appear in the script name.

Regards

JamWales
0
 
LVL 10

Expert Comment

by:Banthor
ID: 36895001
Is the Number 4532 possibly in the forms collection.
Doe he URI DisplayMakes.asp#4532 appear in the link of the previous page?
0
Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

 

Author Comment

by:Jamie
ID: 36895710
Hi Banthor,

No it's not  - but as it turns out, following further research, I'm asking the impossible;

http://www.mikeduncan.com/named-anchors-are-not-sent/

Needs to be done via JQuery/Javascript - with me then picking us the result via asp someone?!

Regards

JamWales
0
 

Author Comment

by:Jamie
ID: 36895719
Hi Banthor,

Apologies - I forgot to thank you for your reply to my question - as I do rely heavily on EE when I have a problem - and do appreciate all replies I receive.

Regards

JamWales
0
 

Author Comment

by:Jamie
ID: 36897275
Hi All,

Got it working, although probably not in the most elegant of ways;

<script type="text/javascript">
AnchorTag = location.hash;
document.cookie= "AnchorTag" + "=" + AnchorTag;
</script>
<%
AnchorTagASP = & Replace(Request.Cookies("AnchorTag"),"#","")

Any better way of achieving this?

Regards

JamWales
0
 

Author Comment

by:Jamie
ID: 36897370
Hi All,

I spoke far too soon - further testing shows my solution does not work at all - so back to the drawing board!

Regards

JamWales
0
 
LVL 28

Accepted Solution

by:
sybe earned 1000 total points
ID: 36901754
Interestingly Classic ASP can't do that (as others have made clear).

But then again: why would you? The anchor is (or should not be) not of interest to the generation of the page. It is only an indication for the browser where to jump in the page. It is a client-side concept.

 If it is of interest in the generation of your page, you should rethink your concept and use the value in a querystring.
0
 

Author Comment

by:Jamie
ID: 36904575
Hi Sybe,

I was trying to avoid using querystring - and was looking to trap the archor tag, so that I could increase the font size/color to the jump to point on the webpage, but as you say this is not possible.

Regards

JamWales

0
 
LVL 10

Expert Comment

by:Banthor
ID: 36907131
Makes perfect sense, the #Anchor tag is a location in the document and the document does not exist until rendred.
0
 

Author Closing Comment

by:Jamie
ID: 36908084
Hi Sybe,

Whilst I now accept what I ask is impossible - it would have been nice had it worked!

Regards

JamWales
0

Featured Post

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn how to count occurrences of each item in an array.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

649 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