Skip to content

WebViewNavigationCompletedEventArgs.IsSuccessful

property · WebViewNavigationCompletedEventArgs · cAlgo.API

DesktopCLICloud

True if navigation was successful otherwise false.

Environment behaviour

CLI — not supported. Never raised in the CLI: the events that pass it never fire there (WebView.NavigationCompleted).

Cloud — not supported. Never raised in the cloud: the events that pass it never fire there (WebView.NavigationCompleted).

Definition

public bool IsSuccessful {get;}
webViewNavigationCompletedEventArgs.IsSuccessful: bool

Returns bool

Examples

protected override void OnStart()
{
    var webView = new WebView();
    webView.NavigationCompleted += OnNavigationCompleted;
    Chart.AddControl(webView);
    webView.NavigateAsync("https://ctrader.com/");
}

private void OnNavigationCompleted(WebViewNavigationCompletedEventArgs args)
{
    if (!args.IsSuccessful)
        args.WebView.NavigateToStringAsync("<h1>Page could not be loaded</h1>");
}
def on_start(self):
    webView = WebView()
    webView.NavigationCompleted += self.on_navigation_completed
    api.Chart.AddControl(webView)
    webView.NavigateAsync("https://ctrader.com/")

def on_navigation_completed(self, args):
    if not args.IsSuccessful:
        args.WebView.NavigateToStringAsync("<h1>Page could not be loaded</h1>")