& causing validation problems

Discussion in 'ASP General' started by Mudiya Dissa, Apr 27, 2007.

  1. Mudiya Dissa

    Mudiya Dissa Guest

    Hi,

    I have some code on my application like the following

    <%

    redirectUrl = "mypage.asp?type=100&id=something&view=10

    'some more asp code

    %>

    <a href="<%=redirectUrl%>">Some Link</a>

    the above code works fine but throws validation errors.

    the errors are

    # olumn 81: cannot generate system identifier for general entity "id".


    An entity reference was found in the document, but there is no reference
    by that name defined. Often this is caused by misspelling the reference
    name, unencoded ampersands, or by leaving off the trailing semicolon
    (;). The most common cause of this error is unencoded ampersands in URLs
    as described by the WDG in "Ampersands in URLs".


    and there are some more errors caused of this( I haven;t listed them all
    here)

    if I change the code to the following


    <%

    redirectUrl = "mypage.asp?type=100&amp;id=something&amp;view=10"

    'some more asp code

    %>

    <a href="<%=redirectUrl%>">Some Link</a>

    This will validate but when the users click on the url they will be
    taken to "mypage.asp?type=100&amp;id=something&amp;view=10" which is not
    correct.

    Is there a way to overcome this problem.

    I can change the code to be like this

    <a href="mypage.asp?type=100&amp;id=100">Some Link</a>

    but if I have to use the same link over and over again it's too hard to
    change anything.





    *** Sent via Developersdex http://www.developersdex.com ***
    Mudiya Dissa, Apr 27, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DC Gringo
    Replies:
    3
    Views:
    6,104
    mikeb
    Aug 19, 2004
  2. =?Utf-8?B?UGF1bCBL?=

    Validation summary causing problems with filters

    =?Utf-8?B?UGF1bCBL?=, Sep 17, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    304
    =?Utf-8?B?UGF1bCBL?=
    Sep 17, 2004
  3. DC Gringo

    encoding of "&" vs "&amp;" in url

    DC Gringo, Aug 4, 2005, in forum: ASP .Net
    Replies:
    8
    Views:
    16,905
    davitz38
    Feb 5, 2010
  4. Replies:
    1
    Views:
    671
    Rosanne
    Oct 11, 2005
  5. nnguyen
    Replies:
    3
    Views:
    443
    nnguyen
    Dec 11, 2009
Loading...

Share This Page