Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7644317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:39:30+00:00 2026-05-31T09:39:30+00:00

I am trying to dynamically pass a double array from C# to some JavaScript

  • 0

I am trying to dynamically pass a double array from C# to some JavaScript code. Here’s how I am doing it now:

var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
var jsLat = serializer.Serialize(lat);

I then call InvokeScript with jsLat as parameter.

When I try lat.length on the JS side, I get the correct length, but when I try to do lat[#] all the values come back as undefined.

Also, when I do alert(lat.valueOf()) I see all the values.

Why are all the values coming back as undefined?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T09:39:32+00:00Added an answer on May 31, 2026 at 9:39 am

    You are looking for JSON.parse function on JavaScript side supported by all modern browsers. Unless you need to support IE7/IE6 it is built in function, for IE6/7 there are JavaScript implementations (check out http://json.org for details).

      var result = JSON.parse("{lat:1234, lon:567"})
    

    If you are using jQuery you can use jQuery.parseJSON that supports all browsers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to pass a dynamically created id from a form to JavaScript. <script
I'm trying to initialise some data values dynamically inside a javascript object, but when
I'm trying to figure out how to pass 2D array, which is constructed dynamically
I'm trying to build some code for dynamically sorting a Linq IQueryable<>. The obvious
Possible Duplicate: Passing JavaScript Array To PHP Through JQuery $.ajax I'm trying to pass
I am trying to access data from a javascript object in order to dynamically
When trying to dynamically load a Javascript file using jQuery I keep getting a
I am trying to dynamically create a Bitmap Image using byte array using following
I am trying to pass dynamically created form fields to a php script, and
I am trying to pass form name dynamically. But this script is showing an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.