.NET MVC:从视野中回传的复杂对象或列表阵列控制器 [英] .NET MVC : Pass back complex object or list array from view to controller

查看:147
本文介绍了.NET MVC:从视野中回传的复杂对象或列表阵列控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从查看到提交表单的控制器传递一个列表阵列。 我可以通过使用Html.hidden()函数传递回简单值。但是,一个人如何传回一个复杂的对象或List阵列

I want to pass a list array from the View to the controller on submission of the form. I can pass back simple values by using the Html.hidden() function. But how does one pass back a complex object or a List array

推荐答案

您可以使用JSON或看看下面的例子

You can either use Json or look into the following example

http://blog.stevensanderson.com/2010/01/28/editing-a-variable-length-list-aspnet-mvc-2-style/

这篇关于.NET MVC:从视野中回传的复杂对象或列表阵列控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆