How to have &/& in web.config file How to have &/& in web.config file asp.net asp.net

How to have &/& in web.config file


Make sure it is written using proper Xml encoding (which, amont other things, will replace all '&' characters with '&').

This should work well:

<add key="uri" value="http://www.google.co.in/search?hl=en&rlz=1R2SKPB_enIN332&ei=yktESuLfIIbg7APpquQj&sa=X&spell=1" />


Web.config needs to be valid XML - so replace the & with &. When you read it from your config u can always convert it back with HtmlDecode