0

In Page_Load on server side, I got an array of array as:

[['1_1','2_1','3_1','4_1'],['1_2','2_2','3_2','4_2'],....]

(Image to example):
enter image description here

How can I pass that array to client to use in javascript function?

1 Answer 1

1

One way, serialize this array and on the page create a JavaScript variable with this serialized value. E.g.

In C#, serialize it -

new JavaScriptSerializer().serialize(Object)

In JS access it -

var arr = <%= serializedArray %>

Other way, when the page loads, create ajax to fetch this data. Refer this article

Sign up to request clarification or add additional context in comments.

1 Comment

Work great. Thank you so much.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.