Textbox Width Issue (Rendered differently for different browsers)

J

Jeff

Using ASP.NET 1.1

I have an <asp:TextBox... for which I set the width property --- "width=30".

The textbox is being rendered to the browser like this:

<input name="someName" type="text" maxlength="3" id="someID"
style="width:30px;" />

Notice the [Width=30] gets rendered as [style="width:30px;"]. This causes
the textbox to be 30 pixels wide, at least in IE and Opera.

I have discovered in testing that the [style="width:30px;"] part is *omitted
completely* from the rendered HTML when the page is requested by FireFox or
Netscape Navigator (6.2) - so the textbox (really <input... />) gets some
default width rather than being set to 30 pixels wide.

What can I do to set the width the same for FireFox and NN (same as for IE)?

Thanks!
 
S

Showjumper

Dont use inline styles. Rather use the cssclass property and set it to a
class defined in your stylesheet. The problem w/ the inline styles is that
asp.net see gecko browser as downlevel and as such doesnt send the inline
style info. And i would have thought that it woulndt send it to opera either
since it considers only ie as uplevel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top