HtmlHelper.AttributeEncode Method (String)
Returns an HTML-encoded string that represents the specified string by using a minimal encoding that is suitable only for HTML attributes that are enclosed in quotation marks.
Namespace: System.Web.WebPages.Html
Assembly: System.Web.WebPages (in System.Web.WebPages.dll)
Syntax
'Declaration
Public Function AttributeEncode ( _
value As String _
) As String
'Usage
Dim instance As HtmlHelper
Dim value As String
Dim returnValue As String
returnValue = instance.AttributeEncode(value)
public string AttributeEncode(
string value
)
public:
String^ AttributeEncode(
String^ value
)
member AttributeEncode :
value:string -> string
public function AttributeEncode(
value : String
) : String
Parameters
- value
Type: System.String
The string to encode.
Return Value
Type: System.String
An HTML-encoded string that represents the original string.
Remarks
Minimal HTML-encoding converts only double-quotation ("), ampersand (&), and less than (<) characters to their corresponding HTML escape sequences. This is faster than full HTML encoding, but is suitable only for encoding HTML attributes that are in double quotation marks.