html - C# HtmlEncode name only -


According to the table, I have to encode a string in C # in the following way: Encoded only the characters named HTML, with their HTML name in the link from the table (and the symbols that HTML name Do not keep the same, and should not be replaced with their HTML number ).

For example: I get the string & amp; ' should be encoded ; ', but the results I'm getting are giving it & amp; Amp; & Amp; # 39; , it is converting a symbol that does not have an HTML name.

  HttpUtility.HtmlEncode ();  

is encoding for both HTML name and HTML number.

Update: Using Microsoft.Security.Application Trying to do Encoder.HtmlEncode () is also giving the same encoding results.

Any suggestions for other solutions?

Any suggestions for other solutions or a way of implementing Microsoft.Security ??

Have you tried adding the system? Security Dell Manually?

Browse the reference folder in the solution, rightclick, add references, assembly, framework, system. Security, check the box and press OK.

You should now be able to add:

  using System.Security  

at the top of your C # file .


Comments