I have a multiline textbox :
<asp:TextBox ID="txtBody" runat="server" TextMode="MultiLine" Rows="10" Width="95%" />
In ie there is a vertical scrollbar bar even if a text inside textbox doesn’t occupy 10 lines.
In firefox it does not happen, scroll bar appears only if text exceeds 10 lines.
What can be done?
Set CSS style overflow to auto:
The default behavior differs between browsers, which is why you see different behavior in IE and FF when
overflowis not specified.To override default browser behaviour for all multiline textboxes on your page, you can add it in a style definition. Then you don’t need to include the inline style on each textbox:
Note: Multiline TextBox is rendered using HTML tag
<textarea>, so we will specify the css style for thetextareaelement type.