获得隐藏输入的价值 [英] get value of hidden input
本文介绍了获得隐藏输入的价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
你能帮我吗?我希望在点击 ActionLink 后获得< input type =inputname =hiddenbranchid =hiddenbranchvalue =/> 的价值
我的观点:
< input type =inputname =hiddenbranchid =hiddenbranch value =/>
@ Html.ActionLink(搜索,AcctSearch,AcctConfirmation,null,新
{
@class =openDialog,
data_dialog_id =searchDialog,
data_dialog_title =帐户代码
})
控制器:
< pre lang =cs> public ActionResult AcctSearch(FormCollection formCollection)
{
var sample = formCollection.Get( hiddenbranch);
}
请赐教..
问候,
naijeru
解决方案
< 输入 type = input 名称 = hiddenbranch value = @ Model.YourValueProperty / >
@ Html.ActionLink(搜索,AcctSearch,AcctConfirmation,新的
{
@hiddenBran chId=@Model.YourValueProperty
@class =openDialog,
data_dialog_id =searchDialog,
data_dialog_title =帐号
},null)
[HttpGet]
public ActionResult AcctSearch( int hiddenBranchId)
{
var sample = hiddenBranchId;
}
希望这有帮助
Hi guys,
would you please help me? i want to get value of my <input type="input" name="hiddenbranch" id="hiddenbranch" value="" /> upon clicking my ActionLink
my views:
<input type="input" name="hiddenbranch" id="hiddenbranch" value="" /> @Html.ActionLink("search", "AcctSearch", "AcctConfirmation", null, new { @class = "openDialog", data_dialog_id = "searchDialog", data_dialog_title = "Account Code" })
controller:
public ActionResult AcctSearch(FormCollection formCollection)
{
var sample = formCollection.Get("hiddenbranch");
}
please enlighten me..
regards,
naijeru
解决方案
<input type="input" name="hiddenbranch" value="@Model.YourValueProperty" /> @Html.ActionLink("search", "AcctSearch", "AcctConfirmation",, new { @hiddenBranchId=@Model.YourValueProperty @class = "openDialog", data_dialog_id = "searchDialog", data_dialog_title = "Account Code" },null)
[HttpGet] public ActionResult AcctSearch(int hiddenBranchId ) { var sample = hiddenBranchId ; }
Hope this helps
这篇关于获得隐藏输入的价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文