|
XML rules make is so that the & character is the token for beginning of a reference. With ASP.NET, you have the ability to store application specific settings (AppSettings) and connectionStrings to name a few. Persay you wanted to store a url with a query string in it eg: <appSettings> <add key="myLink" value="http://mapserv.utah.gov/SGID?map=true&county=salt lake"/> </appSettings> Your .NET application would throw and error and say you needed a semi colon. Another example would be storing the connection string to a sql database. <connectionStrings> <add name="ConnectionString" connectionString="Data Source=mySqlDatabase;Initial Catalog=Table;User ID=ADMIN;Password=&password&" providerName="System.Data.SqlClient"/> </connectionStrings> This would not compile.
The solution to the problem is relatively simple but if you didn't know better it may be a bit of a stumper. All you need to do is convert your & to & The above samples would be <appSettings> <add key="myLink" value="http://mapserv.utah.gov/SGID?map=true&county=salt lake"/> </appSettings> <connectionStrings> <add name="ConnectionString" connectionString="Data Source=mySqlDatabase;Initial Catalog=Table;User ID=ADMIN;Password=&password&" providerName="System.Data.SqlClient"/> </connectionStrings> And your off! |