473,785 Members | 2,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Incorrect Mozilla renderings

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?

Nov 18 '05 #1
4 1171
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=Syste m.Web.UI.HtmlTe xtWriter
</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" <no***@yahoo.co m> wrote in message
news:41******** *******@yahoo.c om...
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?

Nov 18 '05 #2
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=Syste m.Web.UI.HtmlTe xtWriter
</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" <no***@yahoo.co m> wrote in message
news:41******** *******@yahoo.c om...
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?


Nov 18 '05 #3
On Tue, 16 Nov 2004 04:25:05 GMT, No One <no***@yahoo.co m> 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)
Nov 18 '05 #4
Ted Harper wrote:
On Tue, 16 Nov 2004 04:25:05 GMT, No One <no***@yahoo.co m> 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.
Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1672
by: Neil Zanella | last post by:
Hello, I just ran into an interesting problem with cookies while using PHP 4 and Mozilla 1.6. Basically, I have been using PHP on a site called: foo.bar.net?script.php Within that script I call setcookie() and manipulate cookie variable $_COOKIE. All works fine
4
2395
by: Jakub Fast | last post by:
Hi, Does anybody know how far you can get nowadays with trying to use Python as the script language for XUL instead of JS? Is it possible (even theoretically) to write full-fledged applications on the Mozilla platform with python only? In a parallel vein, anybody know what the architecture of Komodo is? Thanks for any pointers, information, etc
0
1780
by: melledge | last post by:
Mozilla Foundation Co-Hosts Europe's Leading XML and Web Developer Conference XTech 2005 Conference to Bring Together XML and Web Technology Thought Leaders
15
7306
by: Peter Bremer | last post by:
Hi all, I've written this little piece of code, which doesn't seem to work in Mozilla 1.5. I haven't tried it on other Gecko browsers, but I've found some indication that Netscape 6+ has the same problem. Internet Explorer 6 and Opera 7 have no problems with it. <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'> <script>document.write (window.history.length);</script>
5
3819
by: Mathias Schreiber [wmdb] | last post by:
Hello list, I am quite new to the whole concept of CSS2 driven websites and am now stuck a bit. Take a look: http://www.pudaluda.com/fileadmin/templates/pudaludabarrierefrei.htm This page renders correct (means: like I think it should) in IE6 - Mozilla Firefox 0.9.3 does not display the background color nor the
7
1332
by: Severus Snape | last post by:
If you open a window with resizable=no, Opera doesn't comply.
49
2985
by: Aidan | last post by:
I rely heavily on MSDN for documentation when it comes to HTML/DHTML/JavaScript/CSS but as a result I often have problems getting my stuff to work in Netscape/Mozilla/Firefox. I like the MSDN online documentation (http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/re ference/objects.asp) because it has complete lists of DHTML objects, properties, methods, collections and event and for each element you can easily view...
10
2376
by: News | last post by:
I have a page up trying to learn how to ID a browser and other info. http://wyght.com/warren/testPos.html here is the code <script type = "text/javascript"> var space = ", "; var name = navigator.appName;
0
10341
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10095
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8979
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5513
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2881
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.