3
  1. Is there any difference between HttpUtility.HtmlEncode() method and Server.HtmlEncode() method?
  2. If not, what for one method duplicates another?
Pal
  • 756
  • 2
  • 10
  • 20

2 Answers2

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
2

Look at this

StackOverflow

and may be this can help too

codeproject

Hope this help!

Community
  • 1
  • 1