HttpUtility.HtmlDecode driving me crazy!!!!

Posted by Savvas Sopiadis on Stack Overflow See other posts from Stack Overflow or by Savvas Sopiadis
Published on 2010-05-20T13:51:41Z Indexed on 2010/05/20 14:20 UTC
Read the original article Hit count: 367

Filed under:
|

Hi everybody!

This situation is driving me crazy!!: the following snippet does not work (as i should)

...
string preResult =  doc.DocumentNode.SelectSingleNode("//textarea[@name='utrans']").InnerText
return HttpUtility.HtmlDecode(preResult);
...

The first line assigns a value (e.g.) "<b> Dummy value: </ b> into preResult (that's expected).

BUT the next line gives AGAIN the same value!!! But it should return "<b> Dummy value: </ b>".

Debugging these lines i thought to copy and paste the value directly into HttpUtility.HtmlDecode() and guess what...it worked!!! I got the expected value!

Of course this is useless, but it proves something weird is going on...what?!!

Has anybody faced the same situation again? (dev.env. VS2008,.NET3.5SP1)

Thanks in advance

© Stack Overflow or respective owner

Related posts about c#

Related posts about htmldecode