i have a javascript array and want to access it when the page is posted on the server. Is this possible? I should be able to access the array using asp.net code. Thank you very much and have a nice day!
2 Answers
You can use HiddenField(runat=server) and store it there with comma separated value. and then access your hidden field in code behind.
to store in hidden field:
document.yourformname.Hidden1.value = test.join();
<input id="Hidden1" type="hidden" runat="server" />
Code Behind:
test = document.yourformname.Hidden1.value.split(",");
1 Comment
YS.
You can try saving it in
JSON and use Json.net (or other libs) to deserialize it.