Export (0) Print
Expand All

HtmlHelper.AttributeEncode Method

Converts the specified attribute value to an HTML-encoded string.

Public method AttributeEncode(Object) Converts the specified attribute object to an HTML-encoded string.
Public method AttributeEncode(String) Converts the specified attribute string to an HTML-encoded string.

The AntiForgeryToken method converts only quotation marks ("), ampersands (&), and left angle brackets (<) to equivalent character entities.

The string result should be used only for double-quoted attributes. Security issues might arise when using the AntiForgeryToken method with single-quoted attributes.

Community Additions

© 2015 Microsoft