我有文本框
@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" })
请帮忙,谢谢
答案 0 :(得分:0)
首先为动作链接提供ID属性,如下所示:
npm install
然后为ActionLink编写一个jQuery单击事件函数:
@Html.ActionLink("Preview", "Update", "Home", new { @report_id = Request.QueryString["report_id "] }, new { @class = "btn btn-info", target = "_blank", id="alink" })
看看它是否适合你。