Table of Contents

Class CoreWebView2ExecuteScriptResult

Namespace
Microsoft.Web.WebView2.Core
Assembly
Microsoft.Web.WebView2.Core.dll
public class CoreWebView2ExecuteScriptResult
Inheritance
CoreWebView2ExecuteScriptResult
Inherited Members

Properties

Exception

If Succeeded is false, you can use this property to get the unhandled exception thrown by script execution

public CoreWebView2ScriptException Exception { get; }

Property Value

CoreWebView2ScriptException

ResultAsJson

A function that has no explicit return value returns undefined. If the script that was run throws an unhandled exception, then the result is also null.

public string ResultAsJson { get; }

Property Value

string

Succeeded

This property is true if ExecuteScriptWithResultAsync(string) successfully executed script with no unhandled exceptions and the result is available in the ResultAsJson property.

public bool Succeeded { get; }

Property Value

bool

Methods

TryGetResultAsString(out string, out int)

If Succeeded is true and the result of script execution is a string, this method provides the value of the string result, and we will get the false var value when the js result is not string type.

public void TryGetResultAsString(out string stringResult, out int value)

Parameters

stringResult string
value int