Hi,
I am using the App.Config file to store few mail settings including the static text that will be used to send the mail. All the key/value pair is working fine except for the static content pair where in I am not able to use HTML formatters to format the mail message. I am using the following statement:
------------------------------------------------------------------------------
<
add key="MailStaticContent" value="Hi,<br />Please find attached your daily report.<br /><br />Thanks,<br />Reporting System<br /><br />Note: Do not reply to this auto-generated message. To send mail to the Coordinator, please use the application's 'Send Mail' link."/>------------------------------------------------------------------------------
I get the following message:
Application Configuration file "App.config" is invalid. '<', hexadecimal value 0x3C, is an invalid attribute character. Line 21, position 44.
It is a mandate as per the design to use a HTML based mail and the values should be managed through the App.Config.
Any suggestions on how to rectify this issue?

Jan MontanoRank #1,295 · 1.3K reputationPosted Jan 1, 2009, 7:13 PM EST
< < less than
> greater than
& & ampersand
' ' apostrophe
" " quotation mark
instead of
try <br>
Sumit Bhatnagar5 reputationPosted Jan 1, 2009, 7:39 PM EST
Hi,
Thanks for the reply. It worked. I have few more queries :):
1. Normally we can use HTML tags such as
in the string within the double quotes. Why doesn't it work in the current scenario?
2. What are the various scenarios that we will have to fall back onto <, etc notation.
3. What is the name given to this notation? And any source that lists all these notations.
Jan MontanoRank #1,295 · 1.3K reputationPosted Jan 1, 2009, 7:59 PM EST
It's an XML issue. treat it as some sort of escape characters for those symbols. And if we need those literals to appear, we need to have an escape character so that it could be interpreted correctly.
Like in C#, if we need to specify the backslash as a string literal we put it like "\\" so that it could be displayed correctly. In XML, ampersand and brackets are special characters like the backslash in c#.
XML 1.0 Fifth Edition
Sumit Bhatnagar5 reputationPosted Jan 1, 2009, 8:30 PM EST