Hismile,
You have add the reference but not imported the namespace.
You need to import the namespace.
C#
using System.Web;
VB.Net
Imports System.Web
If this will not work
Right click the Reference in the Solution Explorer.
Choose Add Reference.
Select the .NET tab.
Search and add System.Net.
Then import the below namespace.
C#
using System.Net;
VB.Net
Imports System.Net
Then use the below code.
C#
WebUtility.HtmlEncode(body);
VB.Net
WebUtility.HtmlEncode(body)