我已經開發了使用MVC剃刀技術C#頁面,我的代碼如下基於枚舉選擇單選按鈕.NET MVC如何隱藏輸入字段
<div class="col-md-4">
<label for="" class="control-label">
IDMS Reference <font color="red">*</font></label><br />
<div class="radio col-md-4">
@Html.EnumRadioButtonFor(m => m.enumIDMSReference, false).DisableIf(() =>
Model.IdmsRef == 2)
</div>
<div class="col-md-4">
<label for="" class="control-label">
IDMS Reference Number <font color="red">*</font></label><br />
@Html.TextBoxFor(m => m.IdmsRefNo, new { @class = "form-control"
}).DisableIf(() => Model.InwardBranch == true)
</div>
和我枚舉類以下,
public enum enumIDMSReference
{
[Description("Applicable")]
Applicable = 1,
[Description("Not Applicable")]
NotApplicable = 2,
}
在這裏,如果我們點擊不適用單選按鈕,然後IDMS參考號碼輸入呸應該禁用ld,並且輸入IdmsRefNo字段應該只爲適用的單選按鈕啓用,以便如何在JQuery或其他任何解決方案中執行此操作? 請任何人幫忙
你能給一個示例代碼嗎? – 2014-11-08 05:16:48
選中此鏈接http://romikoderbynew.com/2012/02/23/asp-net-mvc-rendering-enum-dropdownlists-radio-buttons-and-listboxes/ – 2014-11-08 05:31:33
我無法在該鏈接中找到解決方案。請如果你能幫助,那麼幫助我。 – 2014-11-08 05:43:47