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.
Dig deeper on ASP.NET development best practices
Related Q&A from Daniel Cazzulino
Here Daniel Cazzulino explains how to load a DSL (domain specific language) domain model instance file programmatically. This requires the .NET type ...continue reading
Here we offer a glimpse at 12 of .NET development expert Danny Cazzulino's top ASP.NET questions and answers.continue reading
C# developers should NOT be modifying InitializeComponent method in the code-behind (or any of the variable definitions) by hand.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.