CoreWebView2WebMessageReceivedEventArgs.TryGetWebMessageAsString 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.
Gets the message posted from the WebView content to the host as a string. The message posted from the WebView content to the host.The message posted is some other kind of JavaScript type.
public string TryGetWebMessageAsString ();
member this.TryGetWebMessageAsString : unit -> string
Public Function TryGetWebMessageAsString () As String
Returns
The message posted from the WebView content to the host.
Exceptions
The message posted is some other kind of JavaScript type.
Examples
For example the following postMessage
runs result in the following values returned by TryWebMessageAsString:
postMessage({'a': 'b'}) ArgumentException
postMessage(1.2) ArgumentException
postMessage('example') "example"
Remarks
Run this operation to communicate using simple strings.