How to stop Webview2 reloading website after NavigationCompleted event. VB.NET C#
The first line of FirstPageWebView
should remove the handler again, since it should only be used once.
When you call AddHandler
you acutually have 2 handlers registered, and they will run both on every NavigationCompleted
event.
(I don't know Vb.Net so this code might be wrong, but I hope you get the idea:
Private Async Sub FirstPageWebView(ByVal sender As Object, ByVal e As CoreWebView2NavigationCompletedEventArgs)
RemoveHandler(WebviewForm.WebView21.NavigationCompleted), AddressOf LoginWebpageLoaded
......... more code .........