开发者

How to set property of a Siverlight control from .aspx.cs page?

开发者 https://www.devze.com 2023-03-01 07:24 出处:网络
Here is my code public partial class MainPage : UserControl { public MainPage() 开发者_如何学JAVA{

Here is my code

 public partial class MainPage : UserControl
{
    public MainPage()
 开发者_如何学JAVA   {
        InitializeComponent();           
    }

    public string CurrentPage { get; set; }

Now I want to set the CurrentPage value from my .aspx page load event?

Thanx


if you want to pass in parameters into a Silverlight application from your calling web page you have to specify and assign the parameters inside the <object ... /> tag that you're using to embed the Silverlight app.
An example for such a parameter could be:

<object data="..." type="...">
  <param name="Parameter1" value="Value1" />
</object>

Inside the Application_Startup method (App.xaml.cs) you can query these parameters from the StartupEventArgs' InitParams collection.

If you just want to the get the hosting URL you can use this property from everywhere inside your Silverlight application:

System.Windows.Browser.HtmlPage.Document.DocumentUri
0

精彩评论

暂无评论...
验证码 换一张
取 消