http://truthanduntruth.com/development/jquery/plugins/supertextarea/
MVC的
<%: Html.TextAreaFor(model => model.strConfigOptionDescription, new { maxlength = 100, @class = "TextBoxWidth" })%>
maxlength不起作用,所以要加入这个插件。
<tr>
<th style="width: 350px">
<%: Html.LabelFor(model => model.strConfigOptionDescription)%>:
</th>
<td class="TdWidth">
<%: Html.TextAreaFor(model => model.strConfigOptionDescription, new { maxlength = 100, @class = "TextBoxWidth" })%>
</td>
</tr>
$(document).ready(function () { $("#strConfigOptionDescription").supertextarea({ maxl: 100 }); });