【发布时间】:2016-10-20 16:21:38
【问题描述】:
我有文本框
@Html.TextBox("report_id", null, new { @class = "form-control col-md-7 col-xs-12", @Value = @ViewBag.Reports_ID, @readonly = true })
我想使用 actionlink 将文本框值发送到控制器。但我无法获取文本框值。
@Html.ActionLink("Preview", "Update", "Home", new { @report_id = Request.QueryString["report_id "] }, new { @class = "btn btn-info", target = "_blank" })
请帮忙,谢谢
【问题讨论】:
-
您需要javascript根据文本框中编辑的值更新链接的
href属性(或者只是将文本框括在FormMethod.Get的表格中。添加@没有意义987654326@ - 这只是添加report_id的原始值
标签: asp.net-mvc