Recommended

Skip Navigation LinksHome / Articles / View Article

Search

 
Results Per Page

Found 1 result for ASP.NET 3.5.
Date between: <not defined> and <not defined>
Search in: News , Articles , Tips , Shows , Showcase , Books

Order by Publish Date   Ascending Title   Rating  

  • 6 comments  /  posted by  Denislav Savkov  on  Aug 29, 2008 (more than a year ago)

    If you want to pass initialize parameters to Silverlight application from an HTML/ASPX page, you have to find the place where your Silverlight control is inserted into the page using ASP.NET 3.5 Silverlight control and insert the InitParameters attribute as shown in the code snippet.

    HTML

    <asp:Silverlight .... InitParameters="param1=value1,param2=value2" />

    As you can see you have to insert one new attribute InitParameters into the <asp:Silverlight> element. The syntax for parameters definition is pretty straightforward - you just have to enumerate all parameters and their values separated by commas like this: "parameter1=value1,parameter2=value2,parameter3=value3". Once the initialize parameters have been defined, you can obtain them in your application startup event handler using the InitParams property of the StartupEventArgs like this:

    C#

    private void Application_Startup( object sender, StartupEventArgs e )
    {
        //... Other code here ...
        string param1Value = e.InitParams[ "param1" ];
    }

    That's it!

     




Join the free SilverlightShow webinar 'Silverlight's Power Features: Data Binding in Action' on August 19th 2010, 10:00 am PDT.
In this session Gill Cleeren will make with a complete overview of the data binding features Silverlight 4 has to offer. He will discuss how data binding is the enabler for applying the MVVM pattern and commanding, and will end up reviewing Blend's support for data binding, including the use of design-time data. Read more | Register Now (hide this)