1
即時通訊使用mvc4,我想驗證隱藏字段是必需的。需要隱藏字段驗證mvc
@Html.HiddenFor(x => x.InternalColour , new { id = "InternalColourId" })
我在單擊列表項時通過jquery設置此字段。
我已經用必填屬性裝飾隱藏字段,但無法獲得驗證錯誤以顯示在validationsummary中?
[Required]
public int? InternalColour { get; set; }
可以這樣做嗎?
感謝
客戶端驗證? –
@MuraliMurugesan兩者。認爲你的答案有效。謝謝 – raklos