HtmlHelper.Raw Method (String)

Wraps HTML markup in an HtmlString instance so that it is interpreted as HTML markup.

Namespace:  System.Web.WebPages.Html
Assembly:  System.Web.WebPages (in System.Web.WebPages.dll)

Syntax

'Declaration
Public Function Raw ( _
    value As String _
) As IHtmlString
'Usage
Dim instance As HtmlHelper 
Dim value As String 
Dim returnValue As IHtmlString 

returnValue = instance.Raw(value)
public IHtmlString Raw(
    string value
)
public:
IHtmlString^ Raw(
    String^ value
)
member Raw : 
        value:string -> IHtmlString
public function Raw(
    value : String
) : IHtmlString

Parameters

  • value
    Type: System.String
    The string to interpret as HTML markup instead of being HTML-encoded.

Return Value

Type: System.Web.IHtmlString
The unencoded HTML.

Remarks

The Razor syntax @ operator HTML-encodes text before rendering it to the HTTP response. This causes the text to be displayed as regular text in the web page instead of being interpreted as HTML markup.

Use the Raw method when the specified text represents an actual HTML fragment that should not be encoded and that you want to render as markup to the HTTP response.

See Also

Reference

HtmlHelper Class

Raw Overload

System.Web.WebPages.Html Namespace