jQuery $.ajax() sends a list of URL parameter values as “params[]=…..”
ASP.NET MVC 3 can’t parse those parameters in controller’s action because they are passed with “params[]” name
The example of such parameter is “targets%5b%5d=486F6D655C486F6D655C50656E6775696E732E6A7067”
I was able to add “traditional: true” to my own $.ajax() calls, but now the ajax calls coming from external plugin that I can’t change.
Is there a way to make ASP.NET MVC3 understand “not traditional” URL parameters that sends a list of values?
UPDATE: I also found another global jQuery property “jQuery.ajaxSettings.traditional = true;” will try it too.
You could write a custom model binder:
and then:
or register the model binder globally in Application_Start if you want it to apply to all string array action parameters: