0

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.

4
  • I wonder if the difference is from the fact that you are using .NET 4? My version is 3.5. (for newcomers, this is a continuation of stackoverflow.com/questions/4411419/…) Commented Dec 10, 2010 at 21:11
  • Well I can tell you that maybe YES it is because my previous sites in 3.5 do not suffer fomr this problem.. it's very disappointing when these things happen.. my god isn't therer any good damn reference about this problem somewhere???????????? Commented Dec 10, 2010 at 21:17
  • How are you outputting these strings? Can you post your code? Commented Dec 10, 2010 at 21:39
  • Here there is output: stackoverflow.com/questions/4411419/… Commented Dec 10, 2010 at 21:59

1 Answer 1

0

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?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.