我怎样才能在ASP .NET MVC从动态生成的控件中的数据? [英] How can I get data from dynamic generated controls in ASP .NET MVC?

查看:156
本文介绍了我怎样才能在ASP .NET MVC从动态生成的控件中的数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要生成一个ASP .NET MVC页上的一对夫妇的复选框。我怎样才能找回他们的数据在控制器发布页面后?

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?

推荐答案

使用的Request.Form 系列:

Request.Form["control-id"]

或动作方法声明 FormsCollection 参数,并用它来检索值。

or declare a FormsCollection parameter in your action method and use it to retrieve the value.

这篇关于我怎样才能在ASP .NET MVC从动态生成的控件中的数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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