简体   繁体   中英

Asp.Net encoding configuration

I am using ASP.NET 4 c# 2010. Well my website has some problem with character encoding. It seems that when I generate my output it is htmlencoded. So a ' is encoded with #number;... this is not always a good thing because when I need to dynamically insert jscript in my controls, every ' or " are encoded and js doesn't work properly...

How to correctly tell ASP.NET not to encode? or better telling him that he must correctly manage ' " and other chars like these withput rendering them htmlencoded?

An example of string being output: this.MyControl.Attributes["onfocus"] = "execJs('param')"

well it results so:

<textarea id=".." onfocus="execJs(&#39;param&#39;)">...

This is not correct.

好的,简单地说,没有什么可担心的,在这里它解释了所有内容: JavaScript引擎识别的HTML编码字符串,怎么可能?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM