Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC: How to post an array of textboxes to a controller

Tags:

c#

asp.net-mvc

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.

like image 542
Luke101 Avatar asked Apr 05 '10 00:04

Luke101


Video Answer


2 Answers

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.

like image 112
Roman Avatar answered Oct 05 '22 23:10

Roman


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/

like image 25
Malevolence Avatar answered Oct 06 '22 00:10

Malevolence