This is my script which returns me a array . I have stored that array in a text field now i want to access that text field in code behind and iterate over it to get the items in this array . Is this approach is possible ? Because if i access it from text field it will be an string not an array .
Basically i want this JSON data in my code behind file .
<script type="text/javascript">
function sendArray() {
var newAry = JSON.stringify(data);
alert(newAry);
console.log(newAry);
document.getElementById('dataarray').value = newAry;
}
</script>
<asp:Button ID="MSAVE" runat="server" Text="SAVE" Width="78px"
Enabled="False" CausesValidation="false" OnClientClick="sendArray();" onclick="MSAVE_Click" />
My code behind file
protected void MSAVE_Click(object sender, EventArgs e)
{
String MyArrayFromJs = dataarray.Text;
}
this is what newAry look like