troubleshooting Question

access C# object from Javascript - need help converting to the correct object in JS

Avatar of websss
websssFlag for Kenya asked on
4 Comments1 Solution181 ViewsLast Modified:
I have an object in c# which is

_temperatureData = new float[320, 240];

Open in new window

it looks like this:
I'm calling this in c#
 System.Web.Script.Serialization.JavaScriptSerializer jSearializer = new System.Web.Script.Serialization.JavaScriptSerializer();
            ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "genericName", "SendCSharpTempDataToJS(\'" + jSearializer.Serialize(_temperatureData) +"\');", true);

Open in new window

and then in my aspx page, i can successfully do this:
 function SendCSharpTempDataToJS(_temperatureData) {
            var mystring = "";

Open in new window

I now need to convert the object to the same type I had in the code behind, as i need to access x y data like [0,1] and retrieve the value 280

Any ideas how I would do that?
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros