我試過幾個答案張貼在stackoverflow。但是,以下似乎不工作:剃刀視圖 - C# - 禁用只讀文本框的
@Html.TextArea("Comments", Model.Comments, Model.ReadOnly ? new { @disabled = "disabled"} : null)
我也試過:
@Html.TextArea("Comments", Model.Comments, Model.ReadOnly ? new { disabled = "disabled"} : null)
任何想法,我究竟做錯了什麼?
您的三元操作你看了我的問題嗎?我已經試過 – user5975648
你沒有具體說明你已經看過的答案,我不知道你是否曾經看過。 –
對不起,這是我的錯誤。感謝您指出 – user5975648