Fixed Size Multi-Line Textbox in ASP.NET


Sometimes we don’t want our user to resize multi-line textbox.

To avoid resizing of multi-line textbox, following CSS trick will work:

Let’s write a simple CSS class.


<style type="text/css">
 .noResize {
 resize: none;
 }
</style>

Now just apply the CSS class called “noResize” to your textbox control.

Example:


<asp:TextBox ID="txtMultiline" runat="server" CssClass="noResize" TextMode="MultiLine" Rows="10" Columns="15"></asp:TextBox>

jsfiddle Example

And done. Hope this helps.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s