Ask the Expert

How do I get my ASP.NET prorams to work for Internet Explorer and Netscape Navigator?

How do I make my ASP.NET work similarly for both Internet Explorer and Netscape Navigator? Some of my controls are not working the same in both of them.
Up front, you should "patch" the machine.config file. There's a section called browserCaps which is used to detect the features a browser supports. Unfortunately (suspiciously) Mozila/Netscape capabilities are not properly detected. Inside that section, locate the following element (all in one line):
<case match="^Mozilla/5\.0 \([^)]*\)
(Gecko/[-\d]+ )?Netscape[6|7]/(?'version'(?'major'\d+)(?'minor'\.
d+)(?'letters'w*)).*">

In .NET v1.1 it will be:

<case match="^Mozilla/5\.0 \([^)]*\) (Gecko/[-\d]+ )?Netscape6/
(?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*)).*">

This element defines the features those browsers support. Add the following bellow it:

  <!-- Patch to output attributes for NS6+/Mozilla1.x -->
  tagwriter=System.Web.UI.HtmlTextWriter

What this attribute tells ASP.NET is that Mozilla/Netscape supports tags written in the same way as IE, so that it uses this writer instead of the default Html32TextWriter which omits most attributes, including CSS ones. According to Microsoft?s comments, this patch and future ones will be available from a third party, cyScape, Inc. That's what the machine.config file says at least. But I couldn't find any update so far :S.

This was first published in June 2003

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: