C# – How to add an ampersand for a value in a ASP.net/C# app config file value

asp.netcweb.config

I've got a C# program with values in a config file. What I want is to store ampersands for an url value like…

<appSettings>
  <add key="myurl" value="http://www.myurl.com?&cid=&sid="/>
</appSettings>

But I get errors building my site. The ampersand is not allowed. I've tried various forms of escaping the ampersands to no avail. Anyone know of the correct form to do this? All suggestions are welcome.

Best Answer

Use "&amp;" instead of "&".