Asp.Net编码配置 [英] Asp.Net encoding configuration
问题描述
我使用ASP.NET 4 C#2010。
那么我的网站上有一些问题,字符编码。
看来,当我产生我的输出是htmlen codeD。所以,一个'是带#编号codeD; ...这并不总是一件好事,因为当我需要在我的控制动态插入JScript中,每一个或都设有codeD和js不正常工作...
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...
如何正确告诉ASP.NET不带code?或更好的告诉他,他必须正确地管理'等字符像这些withput使他们htmlen codeD?
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?
字符串作为输出的一个例子: this.MyControl.Attributes [聚焦状态] =execJs('参数')
An example of string being output: this.MyControl.Attributes["onfocus"] = "execJs('param')"
以及它导致这样:
<textarea id=".." onfocus="execJs('param')">...
这是不正确的。
推荐答案
OK知道了,简单地说,没有什么可担心的,这解释了一切:<一href=\"http://stackoverflow.com/questions/4414108/html-en$c$cd-strings-recognized-by-the-javascript-engine-hows-it-possible\">HTML由JavaScript引擎,怎么可能认识恩codeD字符串?
OK got it, simply, there is nothing to worry about, here it is explained everything: HTML Encoded strings recognized by the javascript engine, how's it possible?
这篇关于Asp.Net编码配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!