开发者

Can't get Fragment information from a System.Windows.Control.WebBrowser

I try to get the string after the sign # in my url of my WebBrowser with:

MessageBox.Show(UI_WebBrowser.Source.Fragment);

But it return me a null string! I also tried to navigate to a string like "http://www.google.com/#123" and nothing...

Need help please! :)

PS: my code:

    private void checkIfUpdate()
    {
        UI_WebBrowser.Navigated += new System.Windows.Navigation.NavigatedEventHandler(UI_WebBrowser_Navigated);
        UI_WebBrowser.Navigate("http://www.google.com/#123");
    }

    void UI_WebBrowser_Navigated(object sen开发者_运维知识库der, System.Windows.Navigation.NavigationEventArgs e)
    {
        MessageBox.Show(UI_WebBrowser.Source.Fragment);
    }


Is it possible that the fragment property requires that there is a string between the path and the #?

Try changing http://www.google.com/#123 to http://www.google.com/ig#123

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜