How do I get controls to size properly in all browsers?

ASP.NET doesn't consider browsers such as FireFox downlevel browsers so it doesn't use styles on them. You have to do adjust the browsercaps setting in web.config to get this to work properly. For example:

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

This forces all output to HTML 4.0. It ignores older browsers which is essentially no different than what ASP.NET sends back. There are more complicated ways to do this by explicitly defining which browser supports what but this is the easiest approach.


© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 11/28/04
Comment or report problem with topic