html encoding

  • Thread starter Thread starter Miraj Haq
  • Start date Start date
M

Miraj Haq

I want to save an html tag in web.config,

I know it would work if i encode it by replaceing "<" to "&lt;"

How about double quote charater ( " )?

The below line is giving errors because of it.

<add key="myHTML" value="&lt;img src="host.jpg"&gt;""/>

Please help

Miraj
 
I want to save an html tag in web.config,
I know it would work if i encode it by replaceing "<" to "<"
How about double quote charater ( " )?

Escape it as &quot; as per the XML specification. So, you'd have:

<add key="myHTML" value="<img src=&quot;host.jpg&quot;>" />

[not sure why you had a pair of double quotes at the very end...]
 

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

Back
Top