【发布时间】:2011-04-08 21:44:18
【问题描述】:
想知道是否有更好的方法来使用 ASP.NET MVC2 做到这一点。以下关于 SO 的帖子过时了:
How to pass complex type using json to ASP.NET MVC controller
ASP.NET MVC How to pass JSON object from View to Controller as Parameter
并且在下面的帖子中也没有使用 phil haack 的期货库。 http://haacked.com/archive/2010/04/15/sending-json-to-an-asp-net-mvc-action-method-argument.aspx
基本上我现在正在做的是使用 JavaScriptSerializer 并在 action/actionfilter 中反序列化。
【问题讨论】:
-
这对我来说也很现实!
标签: asp.net-mvc-2