error loading Web.config

G

Guest

I'm getting an error when I use the < symbol in a string in the <appSettings> section
This example works fine
<add key="From" value="(e-mail address removed)"></add

This example causes an error
<add key="From" value="John Doe <[email protected]>"></add

It seems to be seeing the extra <> within the string as tags. How can I force it to see them as literal?
 
T

Teemu Keiski

This is one of the basic things with XML. You need to put < and >'s as &lt;
, &gt; encoded if you want to store them in XML (as XML uses tag characters
as separators normally).

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist


I'm getting an error when I use the < symbol in a string in the
<appSettings> section.
This example works fine:
<add key="From" value="(e-mail address removed)"></add>

This example causes an error:
<add key="From" value="John Doe <[email protected]>"></add>

It seems to be seeing the extra <> within the string as tags. How can I
force it to see them as literal?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top