" instead sign of quote (")

2019-07-16 14:11发布

I have writteln asp.net web projet in C#.

The problem is in saving sign of quote " in a database and displaying this again in a page.

For example there is a textbox and I type following:

"abcd"

and save this in DB.

However, when I read this again and display it in a page I see:

"abcd"

So what is a problem here?Does someone know the solution?

the charset I use is utf8 and colattion is utf8generalci

2条回答
霸刀☆藐视天下
2楼-- · 2019-07-16 14:47

Try use HTML decode and encode

HttpUtility.HtmlDecode

Refer http://msdn.microsoft.com/en-us/library/aa332854%28v=vs.71%29.aspx

查看更多
【Aperson】
3楼-- · 2019-07-16 14:47

This is actually desired behavior - " is the escaped html entity ". It's a security issue to output literal " as it can enable Cross-Site-Scripting or Cross-Site-Request-Forgery.

// sorry, please note freefaller's correct answer below.

查看更多
登录 后发表回答