tags:

views:

437

answers:

2

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?

A: 

Set style overflow to auto:

<asp:TextBox ID="txtBody" runat="server"  TextMode="MultiLine"
 Rows="10" Width="95%" style="overflow:auto;" />
awe
+1  A: 

It is the default behavior of IE. The default value of overflow is visible and IE adds a disabled scroll bar even if the content does not overflow.

You can add a css class to the element

<style>
    .Over { overflow: auto; width: 95%; }
</style>

<asp:TextBox ID="txtBody" runat="server" CssClass="Over" TextMode="MultiLine" Rows="10" />
rahul
better than inline styling, indeed.
Alextronic