问题
I want to generate a couple of checkboxes on an ASP .NET MVC page. How can I retrieve their data in a controller after posting the page?
回答1:
Use the Request.Form collection:
Request.Form["control-id"]
or declare a FormsCollection parameter in your action method and use it to retrieve the value.
来源:https://stackoverflow.com/questions/661575/how-can-i-get-data-from-dynamic-generated-controls-in-asp-net-mvc