How can I get data from dynamic generated controls in ASP .NET MVC?

不问归期 提交于 2019-12-11 17:19:22

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!