vs2010+silverlight4 error
在用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的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 在IIS6 配置使用php5.4的fas
- 下一篇: SQL Server 2017安装错误: