HtmlHelper.AttributeEncode Method (String)
Converts the specified attribute string to an HTML-encoded string.
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
The AntiForgeryToken method converts quotation marks ("), ampersands (&), and left angle brackets (<) to equivalent character entities.
The result should be used only for attributes that are in double quotation marks. Security issues might arise if you use the AntiForgeryToken method to encode attributes that are in single quotation marks.