R – Pass dynamic parameter

silverlightsilverlight-3.0

I want to pass dynamic parameter (UserName) from web application into silverlight . I know how I can do that in Silverlight 2.0 with Asp:Silverlight tag, however as in Silverlight 3.0 there is Object tag instead of Asp:Silverlight tag, I was wondering how can I pass dynamic parameter into Silverlight 3.0? I know we can use init param , however in initparam we can just send static param . In init param you can send param and static value . I need to send dynamic param.

Pleas help,
Thank you

Best Answer

You can dynamically create the SL object control and in it have the parameter. If needed, you can also interact with your control via JavaScript. I assume the dynamic param you speak of is some value from the HTML on the page. If the value changes while the SL control is active, then you will need to use JavaScript to pump the changes to your SL control. If you are getting data from code behind, you can use the <%=SomeProperty%> in the initparms parameter. When using it that way, ASP.Net will pump out the value when the page is being rendered, and then the browser will see it as a static value, but it was dynamically generated.

I hope this helps.

Related Topic