CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Peter's Gekko

public Blog MyNotepad : Imho { }

Firefox and asp.net applications

With so many people advocating the Firefox browser, amongst Marc in his DNJ  blog, I just had to give it a chance. Installation is quick, most sites look OK but I still don't understand what happened to my favorites. The on-line manual mentions several times it will import IE's favorites but there is no mention at all where to find them in firefox.

The most interesting experiment was browsing an ASP.net site. Which was disappointing. Windows authentication does not work. At the start of the session an ff dialog pops up, entering the windows username and pw satifies ff. But most screens don't look right. Some are just blank. The source reveals there is a table, but ff just does not visualize it.

I'm a big fan of datalists. To allign columns I use fixed width labels. A snippet of typical html rendered looks like this:

<td class="LIaitem">
<a id="GekkoDataList1__ctl2_LinkButton3" href="javascript:__doPostBack('GekkoDataList1$_ctl2$LinkButton3','')">-</a>
<span id="GekkoDataList1__ctl2_Label7" style="font-size:Smaller;width:318px;"></span>&nbsp; &nbsp;
<span id="GekkoDataList1__ctl2_Label1" style="width:53px;">            </span>&nbsp;
<a id="GekkoDataList1__ctl2_HyperLink3" href="Projekt.aspx?id=84" style="width:337px;">Dit is een nieuw projekt                          </a>&nbsp;
</td>

In IE this result is nice columns of even width, also when the label is blank.

In Firefox this same pages doesn't look very good. All columns alignment is gone. The html for the same row looks quite different:

<td class="LIaitem">
<a id="GekkoDataList1__ctl2_LinkButton3" href="javascript:__doPostBack('GekkoDataList1$_ctl2$LinkButton3','')">-</a>
<span id="GekkoDataList1__ctl2_Label7"></span>&nbsp; &nbsp;
<span id="GekkoDataList1__ctl2_Label1">            </span>&nbsp;
<a id="GekkoDataList1__ctl2_HyperLink3" href="Projekt.aspx?id=84">Dit is een nieuw projekt                          </a>&nbsp;
</td>

All attributes of the label, including the width, have gone. No wonder the page is garbled. Pages without tables, just labels and textboxes look just as bad. And again all attributes have gone.

If my customers are going to switch to firefox (I actually hope they will not, give opera a chance in case you want to drop IE) I have work to do. For the moment it's end of experiment, got real work to do.

Peter



Comments

Ross said:


File/Import.
# September 15, 2004 3:05 AM

Fredrik said:

Well, is this really errors or missing features in Firefox? The problem is that ASP.NET's server controls doesn't genereate standard compliant html. And that's really bad.

Firefox is based on the same html engine (Gecko) as Mozilla and that is the most standard compliant engine in the world.

/Fredrik
# September 15, 2004 5:32 AM

Scott Galloway said:

This is totally ASP.NET's problem, not the browser. I'd look for one of the updated BrowserCaps bits for ASP.NET which fix many of these sorts of problem...
# September 15, 2004 6:37 AM

JosephCooney said:

I love firefox - I think it is a great browser....my feelings are if pages don't render properly in firefox it is the page's fault not firefox. You can use this http://weblogs.asp.net/mrupp/archive/2003/04/03/4789.aspx to fix some of ASP.NET's problems rendering for firefox. Also Peter - I thought (considering your blog's name) you would be "pro gecko" ;-)
# September 15, 2004 8:38 AM

Darrell said:

For everyone that thinks pages should be 100% strictly validated, let me quote someone much smarter than me in regards to XML, of which XHTML is but a flavor:

"This last one is interesting, in that it tries to wish away Postel’s Law (originally stated in RFC 793 as be conservative in what you do, be liberal in what you accept from others). Various people have tried to mandate this principle out of existence, some going so far as to claim that Postel’s Law should not apply to XML, because (apparently) the three letters X, M, and L are a magical combination that signal a glorious revolution that somehow overturns the fundamental principles of interoperability.

There are no exceptions to Postel’s Law. Anyone who tries to tell you differently is probably a client-side developer who wants the entire world to change so that their life might be 0.00001% easier. The world doesn’t work that way."

...later, in regard to a feed parser, which you can substitute "web browser" for...

"It is as liberal as possible because that is what clients need to be. "
# September 15, 2004 9:28 AM

Darrell said:

Sorry, and the person I am quoting is Mark Pilgrim, you can read the full deal here:

http://diveintomark.org/archives/2004/01/08/postels-law
# September 15, 2004 9:29 AM

Scott said:

The "downlevel browser" list is set in the machine.config I believe. You can edit it to include FireFox/Mozilla, then ASP.NET controls will render the rich controls rather than the dumb ones. I'm not saying that all of them will function perfectly, but I think most of them will function well enough.
# September 15, 2004 9:41 AM

dru said:

<browserCaps>
tagwriter=System.Web.UI.HtmlTextWriter
</browserCaps>

This seemded to help me out a lot and ASP.Net 2.0 will do a much better job.
# September 15, 2004 10:13 AM

Shannon J Hager said:

I have been complaining about the broken rendering that is sent to all non-IE browsers since Beta 2 of v1.0 and quickly learned that using the cool property features of .NET server controls to change the appearance of a control is unusable outside of an intranet. MS put a disclaimer in the machine.config's browse caps section, giving a URL to a 3rs party site where you could find an updated version but that page has said "we're working on a new one, check back later" for the last 3 years. I am starting to think they're not working on it.

There are MANY easy ways to correct this bug (and it is a bug), the easiest being to add a browse caps update to the web.config for sites that use adaptive rendering. You'll notice on sites that don't rely on design-time properties and use CSS instead, there usually isn't a need for the browsecaps change.
# September 15, 2004 10:22 AM

Peter's Gekko said:

Firefox is actually a better browser than ASP.NET realizes
# September 15, 2004 9:25 PM

Shannon J Hager said:

I was looking for this post earlier but couldn't find it. The links in the post below will cover everything you need to know about making .NET play nice.

http://dotnetjunkies.com/WebLog/DotNetRolando/archive/2004/08/19/22564.aspx

# September 15, 2004 10:27 PM

andee said:

Surely firefox should look at the "Content-Type" header and ignore the file extension. Surely that'd work.
# February 13, 2005 9:23 AM

Peter van Ooijen said:

# February 14, 2005 8:02 AM

Jeff said:

When I'm applying for a job if an aspx page does not display I really can't call up the potential employer and tell them to change their server to make it compatible with firefox regardless of how standard it may be.
-Jeff
# February 24, 2005 10:12 PM

Peter van Ooijen said:

You should avoid things which render different in Firefox as in IE. And test your app in (at least) these two browsers.
This is no big deal as the differences are not that great.
# February 25, 2005 6:13 AM

michael said:

i don't think adding the browsercaps code or adding the page directive for clienttarget=uplevel will work for label controls rendering into span elements if the label controls have widths set.

i've already tried this & the label widths are ignored in firefox & netscape. rightly so i believe since span is an inline element & should not have width properties.

i am at a loss & i fear the only compatible solution is to revert back to pre-css design methodolgy & imbed tables within tables!!
# March 14, 2005 5:55 PM

Peter van Ooijen said:

CSS still work very well. The point is what style elements you can put into a style-sheet. This specific absolute width of a label, which VS2003 seems to favor, is not understood by Firefox. Setting the width to a %-e is interpreted quite rigth by IE and FF and renders your pages better in a larger variety of browsers. In that senze Firefox is teaching me how to create better pages. Also in IE.
# March 28, 2005 11:23 PM

Rémy said:

try to type in

Page_Load(..)
{
//...
this.ClientTarget = "ie5";
//...
}
# April 6, 2006 4:40 PM

pvanooijen said:

Isn't that the same as working with browsercaps ? This time from code ?
# April 7, 2006 2:59 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add
Check out Devlicio.us!

This Blog

Syndication

News