开发者

problem with web browser

开发者 https://www.devze.com 2023-03-31 02:13 出处:网络
I\'m try to retrieve the contents of a texblock and put it in awebbrower in order to avoid html content :

I'm try to retrieve the contents of a texblock and put it in a webbrower in order to avoid html content :

desc1 is a variable recovered OnNavigatedTo method when navigating 开发者_StackOverflow中文版between pages the problem is that I generate this exception: invalid ioerationexception plz help thank you

   var desc1 = NavigationContext.QueryString["desc"] as String;
   BrowserControl.NavigateToString("<html>"+desc1+"</html>");


I tried this and it this works for me,

try and set a variable to your desc1, then go back to the xaml editor and create a loaded event handler for your page which will do the webbrowser task

string s;

    public MessAbout()
    {
        InitializeComponent();
        var desc1 = "text" as string;
        s = desc1;

    }

    private void loaded(object sender, RoutedEventArgs e)
    {
        webBrowser1.NavigateToString("<html>" + s + "</html>"); 
    }
0

精彩评论

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