& and &

  • Thread starter Thread starter Tony
  • Start date Start date
& is an & sign when encoded for correct presentation in text so in html
you would say Bill & Ben in your code and it would be presented as Bill
& Ben in the browser. You would only use it in a URL if you wanted to pass
Bill&Ben as an argument. The & sign on the URL is for gluing querystring
parameters together.

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
 
The proper character for an url is & BUT in an HTML document the & character
introduces a character entity. For this reason, when a link is written
inside an HTML document it's better to use & to avoid a possible
confusion. Note that this is an HTML issue, in particular the server will
still see just & (as this is what & means in an HTML document).

See :
http://htmlhelp.com/tools/validator/problems.html.en#amp
 
Hello Tony,

Just to add to partice, read "HTML Document Representation" http://www.w3.org/TR/html4/charset.html
about HTML/URL Encoding

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

T> I see that many pages have & in querystring instead &. What is
T> difference? Can I put page link (url)
T> www.mysite.com/mypage.aspx?lang=EN&ID=15 or I need to write
T> www.mysite.com/mypage.aspx?lang=EN&ID=15
T> What is difference between & and & and what is better?
 
Back
Top