将值从视图传递给控制器

问题描述:

如何将值从View传递给Controller?


任何例子都给我代码?

How pass the value from View to Controller?

Any example give me the code?

视图模型

输入类型=文字名称=reportName/>

input type="text" name="reportName" />

并在控制器中

and in controller

public ActionResult DatafromView(string reportName)

{

字符串报告=报告名称;

public ActionResult DatafromView(string reportName)
{
string report= reportname;

return Something

}

希望它能为你提供帮助