Does anyone know how to do this? Specifically I have two arrays and some floating point numbers in an aspx.cs file and want to use it for a web silverlight app (xaml.cs).
Thanks for the help!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Well, depending on size you may be able to format them as strings, pass them in as initParams, then parse the strings back into the arrays. It’s a round-about process but I think your best bet for communicating directly between aspx.cs and silverlight.
The following link will describe in detail using init params:
http://www.silverlightshow.net/tips/How-to-pass-initialize-parameters-to-Silverlight-application-using-ASP.NET-3.5-Silverlight-control.aspx
That said, if the amount of data grows much, you might consider looking at using a simple web service to manage the data.
If you need to communicate with the aspx page dynamically (I mean, more than just when the page loads), it is possible to use javascript to call methods in silverlight with the
[ScriptableMember]attribute.