& causing validation problems

M

Mudiya Dissa

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top