When I use JQuery to serialize a list of id's for my querystring it produces a url like:
mydomain/mypage?id=1&id=2&id=3&id=4
Here is what my form looks like
<div><input type="text" name="id" value="1" /></div>
<div><input type="text" name="id" value="2" /></div>
<div><input type="text" name="id" value="3" /></div>
<div><input type="text" name="id" value="4" /></div>
<div><input type="text" name="id" value="5" /></div>
<div><a href="#" id="myLink">CLICK ME!</a></div>
<script>
$('#myLink').click(function() {
//see: http://api.jquery.com/serialize/
myids = $('input[name=id]').serialize();
alert( myids );
return false;
});
</script>
-live demo - http://jsfiddle.net/yDpu6/2/
When trying to get the querstring values from my controller ActionResult I only get the first id (eg: 1) but when using Request.Quesrtring["id"] I get all the id's (eg:: 1,2,3,4).
Is there a way that I can pass all the serialized id's into my controller without using Request.Quesrtring["id"]?