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!
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!
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.
Ctrl + C -> Alt + Tab -> Ctrl + V
If you have code in one, and want to use it in another, either build your solution in a modular fashion so that both can reference a shared library of common objects and settings, or just copy and past your code.