using href anchors in asp URLs

Results 1 to 4 of 4

Thread: using href anchors in asp URLs

  1. #1
    Dvorak Guest

    Default using href anchors in asp URLs

    I store a reference to pages in a db table such as:<BR>myLink = ""<BR><BR>Then, to create a link to that page I use:<BR>response.redirect myLink<BR><BR>... Which works fine until I try to place an anchor tag in the URL like so:<BR>myLink = ""<BR><BR>That generates an error "Incorrect syntax near &#039;#mytest&#039;"<BR><BR>Does anyone have any ideas on how this can be done?

  2. #2
    Dvorak Guest

    Default Sorry for the double post.

    Sorry to post that twice, thought it did not make it the first time - my mistake.<BR><BR>Anyway, I have isolated the problem. It refers to the point where I try to parse the URL string for the ID attribute. For some reason, ASP thinks the ID attribute is "7#mytest" instead of "7".<BR><BR>So I suppose that I could search for the "#" sign and replace everything to the right of that with "" and place what is left into the "ID" variable.<BR><BR>I know this probably involves inStr. Any suggestions???

  3. #3
    squeaky Guest

    Default RE: Sorry for the double post.

  4. #4
    Dvorak Guest

    Default RE: Sorry for the double post.

    that does not work.<BR><BR>pagename.asp?ID=7 is not the same as pagename.asp#test?ID=7 (atleast under ASP3.0) the server cannot parse the id attribute when an # appears after the ".asp" extension. Atleast in my testing.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts