Look at this
and may be this can help too
Hope this help!
Question
HttpUtility.HtmlEncode()
method and Server.HtmlEncode()
method?Solution 2
OTHER TIPS
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.