e.InitParams.Keys.Contains("Page")是什么意思?
e.InitParams.Keys.Contains("Page")是什么意思?
private void Application_Startup(object sender, StartupEventArgs e)
{
//this.RootVisual = new MainPage();
if (e.InitParams.Keys.Contains("Page"))
{
if (e.InitParams["Page"].Trim() == "1")
this.RootVisual = new Page1();
else
this.RootVisual = new Page2();
}
}
[解决办法]
判断服务器端配置文件(Default.aspx)中asp:Silverlight节点下的InitParams属性是否包含"Page"键
[解决办法]
<param name="InitParams" value="Language=<%=Session["Language"]%>,UserName=<%=Session["UserName"]%>,Login=<%=Session["Login"]%>" />