0
嗨我是MVC的新手,我隐藏的字段通过jQuery在复选框更改事件中填充。从动态填充的隐藏字段中获取值
是否有可能再得到这个值,并在MVC @Html.ActionLink
使用它呢?
示例代码:
<div class="col-md-3" style="text-align: center;">
<label style="text-decoration: underline;">Quote 3</label>
<br />
<label id="lblQuote3"></label>
<input type="hidden" id="hdfQuote3" />
</div>
<div class="col-md-3 compareButtonDiv" style="text-align: center;">
@Html.ActionLinkNonEncoded("Compare Risks", "CompareRisks", "Lead", routeValues: new { bid = @Request.QueryString.Get("bid") }, htmlAttributes: new { @class = "btn btn-primary btn-md", @title = "Compare Risks" })
</div>
我想从隐藏字段lblQuote3
值并将该值发送到控制器。我想发送价值我把它包含在rootValues
。
您需要使用javascipt的/ jQuery的修改'你的链接 –
@StephenMuecke像这样href'属性? '$(“a”)。attr(“href”,“http://www.google.com/”)' –
是的,这是可行的(但隐藏的输入是非常必要的 - 更新输入的功能可能只是更新href属性?) –