Click or drag to resize

WebBrowserExtensions.LoadHtml Method (IWebBrowser, String, String, Encoding, Boolean)

Version 73.1.130
Registers and loads a ResourceHandler that represents the HTML content.

Namespace:  CefSharp
Assembly:  CefSharp (in CefSharp.dll) Version: 73.1.130.0 (73.1.130.0)
Syntax
public static bool LoadHtml(
	this IWebBrowser browser,
	string html,
	string url,
	Encoding encoding,
	bool oneTimeUse = false
)

Parameters

browser
Type: CefSharp.IWebBrowser
The ChromiumWebBrowser instance this method extends
html
Type: System.String
The HTML content.
url
Type: System.String
The URL that will be treated as the address of the content.
encoding
Type: System.Text.Encoding
Character Encoding
oneTimeUse (Optional)
Type: System.Boolean
Whether or not the handler should be used once (true) or until manually unregistered (false)

Return Value

Type: Boolean
returns false if the Url was not successfully parsed into a Uri

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IWebBrowser. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
`Cef` Native `LoadHtml` is unpredictable and only works sometimes, this method wraps the provided HTML in a ResourceHandler and loads the provided url using the Load(String) method.
See Also