Get the complete URL from the WebBrowser

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bassem
    Contributor
    • Dec 2008
    • 344

    Get the complete URL from the WebBrowser

    Hi,

    How can I get the complete URL from the webbrowser?

    Thanks for your help!

    Bassem

    update:
    I use the WebBrowser to get a query value when it navigates to a page and the page redirect it with a url that contains the query.

    In the Windows Forms control I check the URL property of the WebBrowser in the Navigated event handler.

    How can I proceed the same with the WPF control?
    Last edited by Niheel; Jun 21 '11, 06:32 PM. Reason: when adding info to a question, best to edit the question to add details
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    You should be able to get it from the Source property.

    Comment

    • Bassem
      Contributor
      • Dec 2008
      • 344

      #3
      Thank you Curtis for your reply.

      The Source property does not give me the query string!

      Thanks again.

      Comment

      • Curtis Rutland
        Recognized Expert Specialist
        • Apr 2008
        • 3264

        #4
        Interesting. It does for me, assuming there actually is one. Well, another way is to use the .Uri.Query property of the NavigationEvent Args parameter of the Navigated event.

        Code:
        if (!string.IsNullOrWhiteSpace(e.Uri.Query)) {
            MessageBox.Show(e.Uri.Query);
        }
        One thing I've noticed is that local pages aren't navigating for me, but ones on the internet are.

        Comment

        Working...