Incorrect Mozilla renderings

Discussion in 'ASP .Net' started by No One, Nov 16, 2004.

  1. No One

    No One Guest

    For whatever reason, when an ASP.Net control sees that the browser is
    Mozilla based, it returns HTML code that contains things like <font />
    tags while returning style attributes for IE. I am testing against the
    latest Firefox browser and not the old stinky Netscape 4. Is there a
    way to tell the ASP.Net server to treat Mozilla as a new browser?
    No One, Nov 16, 2004
    #1
    1. Advertising

  2. By default ASP.NET doesn't recognize Mozilla or FireFox as uplevel browsers
    and renders using HTML 3.2.

    There are a number of ways to fix this by overriding Machine.Config or your
    Web.Config and the browserCaps section that defines what various browser
    signatures support.

    The easiest way to force all access to automatically use HTML 4.0 is to
    simply force all output to go to the HtmlTextWriter:

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

    +++ Rick ---

    --

    Rick Strahl
    West Wind Technologies
    http://www.west-wind.com/
    http://www.west-wind.com/weblog/
    http://www.west-wind.com/wwThreads/
    ----------------------------------
    Making waves on the Web


    "No One" <> wrote in message
    news:...
    > For whatever reason, when an ASP.Net control sees that the browser is
    > Mozilla based, it returns HTML code that contains things like <font />
    > tags while returning style attributes for IE. I am testing against the
    > latest Firefox browser and not the old stinky Netscape 4. Is there a
    > way to tell the ASP.Net server to treat Mozilla as a new browser?
    >
    Rick Strahl [MVP], Nov 16, 2004
    #2
    1. Advertising

  3. No One

    No One Guest

    Thanks for the info. I guess M$ can't handle browsers that follow published
    standards.

    "Rick Strahl [MVP]" wrote:

    > By default ASP.NET doesn't recognize Mozilla or FireFox as uplevel browsers
    > and renders using HTML 3.2.
    >
    > There are a number of ways to fix this by overriding Machine.Config or your
    > Web.Config and the browserCaps section that defines what various browser
    > signatures support.
    >
    > The easiest way to force all access to automatically use HTML 4.0 is to
    > simply force all output to go to the HtmlTextWriter:
    >
    > <system.web>
    > <browserCaps>
    > TagWriter=System.Web.UI.HtmlTextWriter
    > </browserCaps>
    > </system.web>
    >
    > +++ Rick ---
    >
    > --
    >
    > Rick Strahl
    > West Wind Technologies
    > http://www.west-wind.com/
    > http://www.west-wind.com/weblog/
    > http://www.west-wind.com/wwThreads/
    > ----------------------------------
    > Making waves on the Web
    >
    > "No One" <> wrote in message
    > news:...
    > > For whatever reason, when an ASP.Net control sees that the browser is
    > > Mozilla based, it returns HTML code that contains things like <font />
    > > tags while returning style attributes for IE. I am testing against the
    > > latest Firefox browser and not the old stinky Netscape 4. Is there a
    > > way to tell the ASP.Net server to treat Mozilla as a new browser?
    > >
    No One, Nov 16, 2004
    #3
  4. No One

    Ted Harper Guest

    On Tue, 16 Nov 2004 04:25:05 GMT, No One <> wrote:

    >Thanks for the info. I guess M$ can't handle browsers that follow published
    >standards.


    I know that is a throwaway line, but the underlying problem is that
    the protocol between browser and server doesn't easily allow the
    browser to enumerate what "things" it supports (by design or based on
    the current user's preference settings), that is, whether JScript
    (whatever level) is enabled/disabled, if it supports DHTML (at all,
    well vs badly), etc.

    So what Microsoft does via part of the server-side config file is
    pattern-match the UserAgent string sent in the header for the browser,
    then based on that sets a number of capability flags that the ASP.Net
    code can then use to "adaptively render" the content in a way that
    hopefully the browser can do a good job of showing.

    Out of the box the pattern-matching strings don't include the
    appropriate ones to detect recent Firefox/Mozilla builds, but if you
    add these (to your machine.config or just the specific web.config for
    your application if you are distributing it), you'll get a really good
    up-level rendering on those browsers.

    If you google for something like firefox web.config browsercaps you
    should find a paste-in addition so your system does correctly "know"
    the capabilities of Mozilla/Firefox family browsers. Specifically
    http://aspnet.4guysfromrolla.com/articles/050504-1.aspx has a good
    background and a cut/paste section you can simply add to the
    web.config for your application.


    ted.h.
    --
    Ted Harper (Sydney, Australia)
    Ted Harper, Nov 16, 2004
    #4
  5. No One

    No One Guest

    Ted Harper wrote:

    > On Tue, 16 Nov 2004 04:25:05 GMT, No One <> wrote:
    >
    > >Thanks for the info. I guess M$ can't handle browsers that follow published
    > >standards.

    >
    > I know that is a throwaway line,


    Then you would know incorrectly. M$'s track record with following published
    standards is notoriously bad.


    >
    > Out of the box the pattern-matching strings don't include the
    > appropriate ones to detect recent Firefox/Mozilla builds,


    And why not? These browsers are newer than IE's engine and it detects that pile
    better.

    But thanks for the info.
    No One, Nov 17, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?ISO-8859-15?Q?Stefan_Schw=E4rzler?=

    what's incorrect ALIAS

    =?ISO-8859-15?Q?Stefan_Schw=E4rzler?=, Aug 3, 2005, in forum: VHDL
    Replies:
    1
    Views:
    454
    Jonathan Bromley
    Aug 4, 2005
  2. Henri
    Replies:
    9
    Views:
    1,812
    Toby Inkster
    Feb 22, 2005
  3. long eddy

    Renderings

    long eddy, Jan 6, 2007, in forum: HTML
    Replies:
    3
    Views:
    401
    Neredbojias
    Jan 9, 2007
  4. Nathan Sokalski
    Replies:
    8
    Views:
    448
    marss
    Aug 13, 2007
  5. Nathan Sokalski

    Different renderings of <br/> and <br></br> in IE6

    Nathan Sokalski, Aug 3, 2007, in forum: ASP .Net Web Controls
    Replies:
    8
    Views:
    234
    marss
    Aug 13, 2007
Loading...

Share This Page