1

I have the following code:

<script type="text/javascript">
var checksSinceLastPostBack = new Array();

function clientSelectedIndexChanged(sender, eventArgs) {
    var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
    var serializedCheckData = checksSinceLastPostBack.serializeArray();

    if (ajaxManager != null)
        ajaxManager.ajaxRequest(serializedCheckData);
}
</script>

The

var serializedCheckData = checksSinceLastPostBack.serializeArray();

doesn't seem to work. Am I misunderstanding this?

Also if this works, how would I deserialize it in the code behind?

EDIT: Sorry, this is in ASP.NET

0

1 Answer 1

2

.serializeArray() is for serializing form elements with name/value pairs, not a normal Array. To convert that to a string you want something like:

var serializedCheckData = checksSinceLastPostBack.join(',');

...or some other delimiter. If you have more complex data you may want to go a JSON route.

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

1 Comment

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.