- Is there any difference between
HttpUtility.HtmlEncode()
method andServer.HtmlEncode()
method? - If not, what for one method duplicates another?
Asked
Active
Viewed 6,871 times
3

Pal
- 756
- 2
- 10
- 20
-
_Well_, since both method are exist, I think they are different ;) – Soner Gönül Aug 14 '13 at 12:49
-
2See http://blog.diegocadenas.com/2008/03/serverhtmlencode-vs-httputilityhtmlenco.html – adaam Aug 14 '13 at 12:53
-
Thanks a lot all of you! Sorry for duplicate - my query for the search maschine wasn't so good :(. – Pal Aug 14 '13 at 13:01
2 Answers
3
1) They are the same.
2) It's a matter of convenience: Server.HtmlEncode() is readily availalble at runtime from a web page for example whereas HttpUtility.HtmlEncode() is a static method that can be used from anywhere.

jtberr
- 51
- 1