如何在mvc 4中将文本框设置为只读? [英] how to make a text box as readonly in mvc 4?
问题描述
这里我有一个显示日期的文本框,并且它允许用户编辑日期,但我想显示日期,不想给任何一个如何做的编辑选项?br />
< input name =txtSubCommStartDateclass =txtborderid =txtSubCommStartDatetype =text
value =@( Model.NotarySubsequentRecord.CommisionStartDate.ToShortDateString()==1/1/0001|| Model.NotarySubsequentRecord.CommisionStartDate.ToShortDateString()==12/31/9999?:Model.NotarySubsequentRecord.CommisionStartDate.ToString( MM / dd / yyyy))size =8maxlength =10tabindex =15/>
提前感谢
< input name =txtSubCommStartDatereadonly class =...
或者用剃须刀
如何制作mvc4文本框readon ly? [ ^ ]
here i have a text box displaying some date in to it and and it allows user to edit the date as well but i wanna show the date and don't wanna give edit option to any one how to do it?
<input name="txtSubCommStartDate" class="txtborder" id="txtSubCommStartDate" type="text"
value="@(Model.NotarySubsequentRecord.CommisionStartDate.ToShortDateString() == "1/1/0001" || Model.NotarySubsequentRecord.CommisionStartDate.ToShortDateString() == "12/31/9999" ? "" : Model.NotarySubsequentRecord.CommisionStartDate.ToString("MM/dd/yyyy"))" size="8" maxlength="10" tabindex="15" />
thanks in advance
<input name="txtSubCommStartDate" readonly class="...
or, in razor
how to make mvc4 textbox readonly?[^]
这篇关于如何在mvc 4中将文本框设置为只读?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!