Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Incorrect Mozilla renderings

Reply
Thread Tools

Incorrect Mozilla renderings

 
 
No One
Guest
Posts: n/a
 
      11-16-2004
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?

 
Reply With Quote
 
 
 
 
Rick Strahl [MVP]
Guest
Posts: n/a
 
      11-16-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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?
>



 
Reply With Quote
 
 
 
 
No One
Guest
Posts: n/a
 
      11-16-2004
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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?
> >


 
Reply With Quote
 
Ted Harper
Guest
Posts: n/a
 
      11-16-2004
On Tue, 16 Nov 2004 04:25:05 GMT, No One <(E-Mail Removed)> 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)
 
Reply With Quote
 
No One
Guest
Posts: n/a
 
      11-17-2004
Ted Harper wrote:

> On Tue, 16 Nov 2004 04:25:05 GMT, No One <(E-Mail Removed)> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Different renderings of <br/> and <br></br> in IE6 Nathan Sokalski ASP .Net Web Controls 8 08-13-2007 06:02 AM
Different renderings of <br/> and <br></br> in IE6 Nathan Sokalski ASP .Net 8 08-13-2007 06:02 AM
Renderings long eddy HTML 3 01-09-2007 03:34 AM
[Mozilla Thunderbird] Incorrect Date Header For 2005 =?ISO-8859-1?Q?Tomi_H=E4s=E4?= Firefox 9 01-08-2005 02:20 AM
mozilla 1.5 from mozilla 1.4 Disco Firefox 6 11-07-2003 04:34 PM



Advertisments