CoreWebView2.NavigateToString(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initiates a navigation to htmlContent
as source HTML of a new document.
public void NavigateToString (string htmlContent);
member this.NavigateToString : string -> unit
Public Sub NavigateToString (htmlContent As String)
Parameters
- htmlContent
- String
A source HTML of a new document.
Examples
webView.CoreWebView2.SetVirtualHostNameToFolderMapping(
"appassets.example", "assets", CoreWebView2HostResourceAccessKind.DenyCors);
string htmlContent =
@"
<head><link rel="stylesheet" href="http://appassets.example/run.css" /></head><body><img src="http://appassets.example/grill.png" /><p><a href="http://appassets.example/winrt_test.txt"> Click me</a></p></body>
";
webview.NavigateToString(htmlContent);
Remarks
The htmlContent
parameter may not be larger than 2 MB (2 * 1024 * 1024 bytes) in total size. The origin of the new page is about:blank
.