By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,304 Members | 3,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,304 IT Pros & Developers. It's quick & easy.

& causing validation problems

P: n/a
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 ***
Apr 27 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.