How to pass Dictionary as a parameter to an ActionResult(stackoverflow.com)
submitted by
crpietschmann(11.3k) 2 years, 7 months ago
I'm using jQuery to make an Ajax call using an Http Post in ASP.NET MVC. I would like to be able to pass a Dictionary of values. I finally figured out the best solution is to pass JSON via the Http Post and use a custom ModelBinder to convert the JSON to a Dictionary. One thing I did in my solution is created a JsonDictionary object that inherits from Dictionary so that I can attach the custom ModelBinder to the JsonDictionary type, and it wont cause any conflicts in the future if I use Dictionary as a ActionResult parameter later on for a different purpose than JSON. read more...
|category: MVC
|Views: 121
tags:
jQuery ASPNETMVC ActionResult Dictionary AJAX another
Everyones tags:
Your Tags: