ASP.NET MVC:如何将一组文本框发布到控制器

时间:2021-03-02 03:38:37

I need to dynamically build a list of textboxes using javascript and jquery. The problem I am having is when the textboxes are posted how do I capture the information in the controller.

我需要使用javascript和jquery动态构建文本框列表。我遇到的问题是发布文本框时如何捕获控制器中的信息。

2 个解决方案

#1


4  

Steve Sanderson has a blog post with sample code showing precisely how to do this: http://blog.stevensanderson.com/2010/01/28/editing-a-variable-length-list-aspnet-mvc-2-style/

史蒂夫桑德森有一篇博文,其中的示例代码精确地展示了如何执行此操作:http://blog.stevensanderson.com/2010/01/28/editing-a-variable-length-list-aspnet-mvc-2-style/

#2


5  

Are you doing something like the the Model Binding To A List example or something different? This kinda looks like a similar question as well.

你在做类似于模型绑定到列表示例或不同的东西吗?这类似于一个类似的问题。

#1


4  

Steve Sanderson has a blog post with sample code showing precisely how to do this: http://blog.stevensanderson.com/2010/01/28/editing-a-variable-length-list-aspnet-mvc-2-style/

史蒂夫桑德森有一篇博文,其中的示例代码精确地展示了如何执行此操作:http://blog.stevensanderson.com/2010/01/28/editing-a-variable-length-list-aspnet-mvc-2-style/

#2


5  

Are you doing something like the the Model Binding To A List example or something different? This kinda looks like a similar question as well.

你在做类似于模型绑定到列表示例或不同的东西吗?这类似于一个类似的问题。