有没有办法可以将文本框的宽度限制为等于 MaxLength 属性?在我现在的情况下,文本框控件被放置在一个表格单元格中,如下所示:
<td class=TDSmallerBold style="width:90%">
<asp:textbox id="txtTitle" runat="server"
CausesValidation="true"
Text="Type a title here..be concise but descriptive. Include price."
ToolTip="Describe the item with a short pithy title (most important keywords first). Include the price. The title you provide here will be the primary text found by search engines that index Zipeee content."
MaxLength="60"
Width="100%">
</asp:textbox>
(我知道我不应该使用 HTML 表格来控制布局......当然是另一个主题)但是有没有办法将实际宽度限制为输入框中允许的最大字符数?