troubleshooting Question

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

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

_temperatureData = new float[320, 240];

it looks like this:
cobj
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);

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

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 the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
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