jQuery Breaks ASP.NET MVC Action Parameters

After upgrading to jQuery 1.4 my jQuery posts that passed in parameters to my MVC actions started failing. I noticed that “[]” was being appended to the parameters.

Instead of this:
param1=123

It looked like this:
param1[]=123

Turns out it had to do with how 1.4 serialized parameters. You can read more about it at the posts below. To fix it, I added this globally on the page for now:

// Enables for all serialization
.jQuery.ajaxSettings.traditional = true;

http://forum.jquery.com/topic/jquery-1-4-breaks-asp-net-mvc-parameter-posting

jQuery 1.4 breaks ASP.Net MVC actions with array parameters

Subscribe to comments Comment | Trackback |
Post Tags:

Browse Timeline


Add a Comment


XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


© Copyright 2009-2010 Alpha Papa Hotel . Thanks for visiting!