problem with web browser
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>");
}
精彩评论