how to code: webView_NavigationStarting c# ? winforms

vmars316 621 Reputation points
2020-10-20T00:19:20.767+00:00

Tia ;

I want to catch a NavigationStarting Event , But no go so far 

        private void webView_NavigationStarting(object sender, CoreWebView2NavigationStartingEventArgs e)
            {
            navigatingTo = e.Uri.ToString();
//            infoBox.Text = "NavigationStarting" + navigatingTo;
            MessageBox.Show("NavigationStarting" + navigatingTo);
            }

Pls , how to do this ?
Tia

Developer technologies | Windows Forms
{count} votes

Answer accepted by question author
  1. Daniel Zhang-MSFT 9,661 Reputation points
    2020-10-20T05:23:17.44+00:00

    Hi vmars316,
    You can catch the NavigationStarting event via following steps:

    1. Right- click the WebView control and choose Properties, and then click the Events tab which at the top of Properties page.
    2. You can find the NavigationStarting event in Properties page and double- click it.
      33484-1020.png
    3. Finally, the code of webView_NavigationStarting NavigationStarting event will be shown in Form1.cs.
      The webView_NavigationStarting event occurs before the WebView navigates to new content.
      More details you can refer to this docuemnt.
      Best Regards,
      Daniel Zhang

    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentationto enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.