1

I have an array in jquery, and I'm adding values on runtime to this array.After I will access this aray from asp.net page ie: jquery:

var marker=[];
marker[0]='world';
marker[1]='sky';

asp.net:

string []values=new string[];
values[0]=marker[0];
values[1]=marker[1];

how can I do it, is there any way to access jquery veriables from asp.net pages

1 Answer 1

1

you can store these values in a hidden field and read them in asp.net code behind

examples here :

To get value set in javascript in code behind

Passing value from code-behind to Javascript

Edit

you can pass this array to a WebMethod using ajax post

JQuery AJAX post to asp.net webmethod never getting called

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

5 Comments

can I add array values to hidden field ?
yes , you can add them as string separated by commas or semicolons , and split them on server
I don't think so , I used it many times , I'll search for better ways and get back to u
I was looked the first link , but I don't use it because I don't know can I use the example free. I'm looking the second example thank you :-)
Can you remove the first link, I will use the hidden field :), because using static methods in asp.net, I can use another non static methods from static methods,[WebMethods] mus be a static method so ,ı can use them

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.