Textbox is tiny on Mozilla Firebird

  • Thread starter Thread starter Tim Zych
  • Start date Start date
T

Tim Zych

When I use IE, the textbox on my webform is normal. When I use Mozilla
Firebird, the textbox is tiny and it is impossible to type text into it.

What must I do to make the textbox viewable with Mozilla?
 
VS.NET tries to help by stripping out some attributes for down level
browsers.
As a workaround, try some code like this in your code behind:
MyTextbox.Attributes.Add("style", "width:325px;")
 
Unfortunately .Net doesn't consider Mozilla an uplevel browser and thus
doesn't generate the proper style sheet code to size the control.

As Steve suggested you can manually fix that, but that's a nightmare if you
need to do this for all controls.

This is all controlled by the browser settings in machine.config. One way to
do this is to add the browser string(s) for mozilla.

What I do instead is hack my local web.config file and just force it to use
HtmlTextWriter which outputs uplevel browser code all the time.
<system.web>

<browserCaps>
TagWriter=System.Web.UI.HtmlTextWriter

</browserCaps>

</system.web>

Be careful with this because this will essentially disable any browser
specific output! This works fine for my apps, but if you have really old
browsers or other PDA/Phone devices attaching this is probably not what you
want.

OTOH, if you output HTML 4 HTML it rarely does no worse then the HTML 3.2
that .Net kicks out - except that it strips off the style info...


+++ Rick ---

--

Rick Strahl
West Wind Technologies
http://www.west-wind.com/
http://www.west-wind.com/webblog/
 
Hi,
in addition to what others have suggested,
make sure if youre using one of the asp.net server controls, to use the
"style" attribute within that tag.
in other words, instead of doing
<asp:textbox id="whatever" width="10px">
try
<asp:textbox id="whatever" style="width:10px;"> (not sure of correct
syntax, but you get idea).

the first example will work ok in IE but not Netscape/Mozilla.

HTH
 
Back
Top