c# - MaxLength="255" property does not seem to be working? -
this question has answer here:
- specifying maxlength multiline textbox 14 answers
i have textbox field maxlength set 255. can enter more 255 characters in textbox. expecting there 255 character limit.is there way control this? need use code behind? can control requiredfieldvalidator?
here code in .aspx
<asp:textbox id="txtcommentaire" runat="server" width="600px" maxlength="255" textmode="multiline" height="90px" style="overflow:hidden" ></asp:textbox>
maxlength doesn't apply when have textmode="multiline".
when use <asp:textbox textmode="multiline">
, <textarea>
rendered page. textarea tags didn't support maxlength attribute until (html5). therefore, when feature designed, microsoft ignored maxlength attribute in multiline mode.
Comments
Post a Comment