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

Handling special character in web.config file

P: n/a
Hi,

Does anyone know how to handle special characters like "<" and ">" in
the web.config file? Something like this would cause my app to not
startup.

<add key="SenderEmail" value="John Doe <jd**@nowhere.com>" />

Thanks,

Ngoc

Jul 15 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi,

Since the web.config is XML, you need to escape the five special characters:
&amp; ? & (ampersand, U+0026)
&lt; ? < (left angle bracket, less-than sign, U+003C)
&gt; ? (right angle bracket, greater-than sign, U+003E)
&quot; ? " (quotation mark, U+0022)
&apos; ? ' (apostrophe, U+0027)

http://en.wikipedia.org/wiki/Charact...ity_references

Ken
Microsoft MVP [ASP.NET]

<Ne*****@gmail.comwrote in message
news:11*********************@75g2000cwc.googlegrou ps.com...
Hi,

Does anyone know how to handle special characters like "<" and ">" in
the web.config file? Something like this would cause my app to not
startup.

<add key="SenderEmail" value="John Doe <jd**@nowhere.com>" />

Thanks,

Ngoc

Jul 15 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.