syinner
asked on
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
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>
Sorry, but what exactly is the issue here?
ASKER
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
I have attached a example of the textbox content.
example-error.txt
Can you post a sceen shot to help us understand your problem?
ASKER
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
example2.doc
Have you tried using a fixed width on the TextBox?
ASKER
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?
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.