Peter's Gekko

Sponsors

The Lounge

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
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


Posted 09-15-2004 6:53 AM by pvanooijen

[Advertisement]

Comments

Grant_Killian as Weblog ; wrote Don't hate the player, hate the game
on 09-14-2004 11:54 PM
Don't hate the player, hate the game
Ross wrote re: Firefox and asp.net applications
on 09-15-2004 3:05 AM

File/Import.
Fredrik wrote re: Firefox and asp.net applications
on 09-15-2004 5:32 AM
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
Scott Galloway wrote re: Firefox and asp.net applications
on 09-15-2004 6:37 AM
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...
JosephCooney wrote re: Firefox and asp.net applications
on 09-15-2004 8:38 AM
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" ;-)
Darrell wrote re: Firefox and asp.net applications
on 09-15-2004 9:28 AM
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. "
Darrell wrote re: Firefox and asp.net applications
on 09-15-2004 9:29 AM
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
Scott wrote re: Firefox and asp.net applications
on 09-15-2004 9:41 AM
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.
dru wrote re: Firefox and asp.net applications
on 09-15-2004 10:13 AM
<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.
Shannon J Hager wrote re: Firefox and asp.net applications
on 09-15-2004 10:22 AM
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.
Peter's Gekko wrote Firefox is actually a better browser than ASP.NET realizes
on 09-15-2004 9:25 PM
Firefox is actually a better browser than ASP.NET realizes
Shannon J Hager wrote re: Firefox and asp.net applications
on 09-15-2004 10:27 PM
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

andee wrote re: Firefox and asp.net applications
on 02-13-2005 9:23 AM
Surely firefox should look at the "Content-Type" header and ignore the file extension. Surely that'd work.
Peter van Ooijen wrote re: Firefox and asp.net applications
on 02-14-2005 8:02 AM
Jeff wrote re: Firefox and asp.net applications
on 02-24-2005 10:12 PM
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
Peter van Ooijen wrote re: Firefox and asp.net applications
on 02-25-2005 6:13 AM
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.
michael wrote re: Firefox and asp.net applications
on 03-14-2005 5:55 PM
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!!
Peter van Ooijen wrote re: Firefox and asp.net applications
on 03-28-2005 11:23 PM
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.
Rémy wrote re: Firefox and asp.net applications
on 04-06-2006 4:40 PM
try to type in

Page_Load(..)
{
//...
this.ClientTarget = "ie5";
//...
}
pvanooijen wrote re: Firefox and asp.net applications
on 04-07-2006 2:59 AM
Isn't that the same as working with browsercaps ? This time from code ?
TheWizard wrote re: Firefox and asp.net applications
on 10-22-2008 1:18 PM

You're right - Firefox interprets the WW3 standard for inline objects like span, such that if they have no content, then they have no width, and actually assigning them a width doesn't change that.

IE is technically 'wrong' on the issue, in that they let you use <span style='width:100px'></span> as a spacer.

What I do is keep a 1 pixel by 1 pixel, transparent gif around, and I use it whenever I need a spacer, giving IT'S width the size I want

Works the same way on every browser.  You can find one pretty easily on the 'net if you look for 'transparent.gif'

Add a Comment

(required)  
(optional)
(required)  
Remember Me?