Table of Contents

Class MvcHtmlString

Namespace
System.Web.Mvc
Assembly
System.Web.Mvc.dll

Represents an HTML-encoded string that should not be encoded again.

public sealed class MvcHtmlString : HtmlString
Inheritance
MvcHtmlString

Constructors

MvcHtmlString(string)

Initializes a new instance of the MvcHtmlString class.

public MvcHtmlString(string value)

Parameters

value string

The string to create. If no value is assigned, the object is created using an empty-string value.

Fields

Empty

Contains an empty HTML string.

public static readonly MvcHtmlString Empty

Field Value

MvcHtmlString

Methods

Create(string)

Creates an HTML-encoded string using the specified text value.

public static MvcHtmlString Create(string value)

Parameters

value string

The value of the string to create .

Returns

MvcHtmlString

An HTML-encoded string.

IsNullOrEmpty(MvcHtmlString)

Determines whether the specified string contains content or is either null or empty.

public static bool IsNullOrEmpty(MvcHtmlString value)

Parameters

value MvcHtmlString

The string.

Returns

bool

true if the string is null or empty; otherwise, false.