Silverlight中嵌入网页
private void bt_xap_Click(object sender, RoutedEventArgs e)
{
GetRichContent("http://lzy/NDCEIRA", UriKind.Absolute);
}
//获取Rich Content
void GetRichContent(string uri, UriKind uk)
{
MapHtml.Children.Clear();
PageLoad chtml = new PageLoad();
HtmlHost hh = chtml.FindName("htmlHost1") as HtmlHost;
hh.SourceUri = new Uri(uri, uk);
MapHtml.Children.Add(chtml);
}
{
GetRichContent("http://lzy/NDCEIRA", UriKind.Absolute);
}
//获取Rich Content
void GetRichContent(string uri, UriKind uk)
{
MapHtml.Children.Clear();
PageLoad chtml = new PageLoad();
HtmlHost hh = chtml.FindName("htmlHost1") as HtmlHost;
hh.SourceUri = new Uri(uri, uk);
MapHtml.Children.Add(chtml);
}
使用htmlhost需要添加如下引用: