Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: Please help: TextBox control expands ignoring width set in percents


Message #1 by "Alex" <alkapin@h...> on Wed, 30 Oct 2002 05:55:47
The problem I have is that if value for textbox coming from BD is longer 
than box predefined width (in % that I set in css file) the box EXPANDS to 
show it all and ruins all table layout! Why the hell it is doing that??? 
It doesn't expands if I set box size explicitly in pixels but in my case I 
cannot do this. So why it doesn't keep width defined in percents???

I create all controls dynamically and add them to page like that:

box = new TextBox()
box.css = SqlReader("control_css")...  (set box width as--->  width: 100%;)
box.text = SqlReader("control_data")... (if value long box will 
expaaaaaaaaaaaaand when page loads)
cell.Controls.Add(box)


So html looks like that:

<table style="width:800px".....>
.
.
<td style="width: xx%"...>
    <input type=text width=100% 
value=ifthisvalueislongcontrolwillexpand...>
</td>
.
.

It only happens in IE6 and not in Netscape7. Any ideas how to defeat this? 
Thanks.

PS: setting  overflow: hidden  doesn't help either :-(

  Return to Index