Silverlight control in aspx page
i have two silverlight user controls name r开发者_JAVA技巧egion.xaml and session.xaml and i want to place them in region.aspx and session.aspx respectively. The problem is that in both the aspx pages i am getting the region.xaml control how to fix it hta in the session.aspx session.xaml control will be displayed.
I have found the solution:
first we need to set the properties in
and then need to ammed the App.xaml file of silverlight application as shown below:
private void Application_Startup(object sender, StartupEventArgs e)
{
string ControlID = "ControlID";
if (e.InitParams.ContainsKey(ControlID))
{
switch (e.InitParams[ControlID])
{
case "RegionControl":
this.RootVisual = new RegionControl();
break;
case "SessionControl":
this.RootVisual = new SessionControl();
break;
default:
break;
}
}
}
精彩评论