• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1020
  • Last Modified:

ASP.NET TextBox with percentage width problem

Hi There, I have an ASP.NET application that is built around a table design. I having odd results in IE and Firefox with a TextBox with percentage width.

As I use this for error messages such as stack traces, instead of scrolling it creates all sorts of havoc with the page.

Any help would be great
<tr><td>Error Message:</td></tr>
<tr><td><asp:TextBox ID="txtErrorMessage" runat="server" Font-Size="Small" Width="80%" TextMode="MultiLine" Height="400"></asp:TextBox></td></tr>

Open in new window

0
syinner
Asked:
syinner
  • 4
  • 4
1 Solution
 
nmarunCommented:
Sorry, but what exactly is the issue here?
0
 
syinnerAuthor Commented:
When I set the textbox with a percentage width I am having unpredictable results. One is when I retrieve a stack trace from the database and insert it into the textbox, weird things start to happen.

I have attached a example of the textbox content.
example-error.txt
0
 
prairiedogCommented:
Can you post a sceen shot to help us understand your problem?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
syinnerAuthor Commented:
As you can see in the example when I put the stack trace into the textbox it throws my alignment out. The column and the textbox size increase. I would expect the textbox to scroll instead? I also put a wrap on the textbox.
example2.doc
0
 
prairiedogCommented:
Have you tried using a fixed width on the TextBox?
0
 
syinnerAuthor Commented:
A fixed width works fine. I am hoping that the textbox (textarea) can cope with a percentage width or a way to make it do so?
0
 
prairiedogCommented:
No. The percentage width means to be changing, it is why it is also called fluid width. If you want to keep the layout the same no matter what screen size the client PC is using, then you should use the fixed width.
0
 
prairiedogCommented:
You can check the styles used at EE web site and you will find a lot of fixed width, that is why EE's layout is very consistent. The fixed width gives you more control of the layout than the percentage width.
0
 
syinnerAuthor Commented:
After a lot of searching I found a resizable jquery plugin.

http://plugins.jquery.com/project/TextAreaResizer

Works like a treat!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now