c# - MaxLength="255" property does not seem to be working? -


this question has answer here:

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

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -