Saturday, March 24, 2012

html encoding

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 ( " )?
The below line is giving errors because of it.
<add key="myHTML" value="<img src="http://pics.10026.com/?src=host.jpg">""/>
Please help
MirajDon't use ", it will work with '.
"Miraj Haq" wrote:

> 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 ( " )?
> The below line is giving errors because of it.
> <add key="myHTML" value="<img src="http://pics.10026.com/?src=host.jpg">""/>
> 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 " as per the XML specification. So, you'd have:
<add key="myHTML" value="<img src="http://pics.10026.com/?src=host.jpg">" />
[not sure why you had a pair of double quotes at the very end...]

No comments:

Post a Comment