将值从视图传递给控制器 [英] Pass the Value from view to controller

查看:72
本文介绍了将值从视图传递给控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将值从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

}

希望它能为你提供帮助


这篇关于将值从视图传递给控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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