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

& and &

P: n/a
I see that many pages have & in querystring instead &. What is
difference? Can I put page link (url)
www.mysite.com/mypage.aspx?lang=EN&ID=15 or I need to write
www.mysite.com/mypage.aspx?lang=EN&ID=15
What is difference between & and & and what is better?
May 4 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
& 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
"Tony" <To*****@gmail.comwrote in message
news:f1**********@magcargo.vodatel.hr...
>I see that many pages have &amp; in querystring instead &. What is
difference? Can I put page link (url)
www.mysite.com/mypage.aspx?lang=EN&ID=15 or I need to write
www.mysite.com/mypage.aspx?lang=EN&amp;ID=15
What is difference between & and &amp; and what is better?

May 4 '07 #2

P: n/a
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 &amp; to avoid a possible
confusion. Note that this is an HTML issue, in particular the server will
still see just & (as this is what &amp; means in an HTML document).

See :
http://htmlhelp.com/tools/validator/...ms.html.en#amp

---
Patrice

"Tony" <To*****@gmail.coma écrit dans le message de news:
f1**********@magcargo.vodatel.hr...
>I see that many pages have &amp; in querystring instead &. What is
difference? Can I put page link (url)
www.mysite.com/mypage.aspx?lang=EN&ID=15 or I need to write
www.mysite.com/mypage.aspx?lang=EN&amp;ID=15
What is difference between & and &amp; and what is better?

May 4 '07 #3

P: n/a
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

TI see that many pages have &amp; in querystring instead &. What is
Tdifference? Can I put page link (url)
Twww.mysite.com/mypage.aspx?lang=EN&ID=15 or I need to write
Twww.mysite.com/mypage.aspx?lang=EN&amp;ID=15
TWhat is difference between & and &amp; and what is better?
May 4 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.