Table of Contents

Class TrustedHTML

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The TrustedHTML interface of the {{domxref("Trusted Types API", "", "", "nocode")}} represents a string that a developer can insert into an injection sink that will render it as HTML. These objects are created via CreateHTML(string, params dynamic[]) and therefore have no constructor.

[Value("TrustedHTML")]
public class TrustedHTML
Inheritance
TrustedHTML
Inherited Members

Remarks

The value of a TrustedHTML object is set when the object is created and cannot be changed by JavaScript as there is no setter exposed.

-Prevent DOM-based cross-site scripting vulnerabilities with Trusted Types

See also on MDN

Constructors

TrustedHTML()

public TrustedHTML()

Methods

ToJSON()

The toJSON() method of the TrustedHTML interface returns a JSON representation of the stored data.

[Value("toJSON")]
public string ToJSON()

Returns

string

A string containing a JSON representation of the stored data.

Remarks