Thursday, September 20, 2007

ASP.Net Ajax Update Panel changes TextBox Width

I had an UpdatePanel inside a table.

The table width was set to 100%.

The TextBox width was set to 90%.

On a button click the text of the TextBox was changed. The page updates asynchronously as hoped but the text box width changed to be larger than the page width. I have read some forum posts and it seems that it is not possible to stop this for some reason.

Instead of setting the width of the TextBox we can set the Columns attribute instead. This is obviously not as good and will cause problems with differing font sizes but is better than any other alternative I have found.

I assume that this is a bug in the Ajax implementation, or possibly within the browser.

No comments: