在用vs2010作silverlight4 的时候,查看设计页面出现下面问题,不知各位大仙怎么解决此问题的,谢谢。
[HTMLPage_NotEnabled]
Arguments:
DeBUGging resource strings are unavailable. Often the key and arguments provIDe sufficIEnt information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=8.0.50401.0&File=System.Windows.Browser.dll&Key=HtmlPage_NotEnabled
at System.windows.browser.HTMLPage.VerifyThreadAndEnabled()
at System.windows.browser.HTMLPage.get_document()
如图所示 :
Google之后,才知道出错原因是用了HTMLPage这个类,然后就发现了另一个东东System.ComponentModel.DesignerPropertIEs,试试管用,好了还是赶紧分享给大家的好:
private voID UserControl_Loaded(object sender,RoutedEventArgs e)
{
// DID the queryString contain an Email address?
if (HTMLPage.document.queryString.Keys.Contains("Email") )//此外为出错的地方
txtEmailTo.Text = HTMLPage.document.queryString["Email"].ToString();
}
Luckily,there is a special class,System.ComponentModel.DesignerPropertIEs,which allows us to check at runtime whether we are in Design Mode or not. We can just add a check on this,and if we are in Design Mode,we get out of the Loaded event handler:
private voID UserControl_Loaded(object sender,RoutedEventArgs e)
{
if (DesignerPropertIEs.GetIsInDesignmode(this))// 在出错前加上这句判断和return语句,就ok 了
return;
// DID the queryString contain an Email address?
if (HTMLPage.document.queryString.Keys.Contains("Email") )
txtEmailTo.Text = HTMLPage.document.queryString["Email"].ToString();
}
此解决方法原文地址:http://www.andybeaulieu.com/Home/tabid/67/EntryID/158/Default.aspx
这个地址中的:Blend Artboard Exceptions and Loaded Event 文章
总结以上是内存溢出为你收集整理的vs2010+silverlight4 error全部内容,希望文章能够帮你解决vs2010+silverlight4 error所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)