Asp.net Forum

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds

Asp : panel

  Asked By: Pedro    Date: Dec 31    Category: Asp.net    Views: 915

I initially liked the asp:Panel as it instills in one a sense of independence as a control.

Indeed you can do this with a panel

hello all

and it works.

But here's one you may not have come across. If you do do the above then it works in IE because the panel renders as a <div>

But - in NN the panel renders as a table - so the above does NOT work.

But something even more weird is that if you take the html that was outputted to IE and paste it into a html file - i.e. the version with the <divs> - it works fine -
so why is it not rendered that way in NN ?? And why is the panel rendered as a table in NN ??

Part of the answer is that if you make a web request you'll end up with the table version not the div version - since it doesn't know what browser is requesting.

What does this mean ???

Tell me if I am wrong - but does this not suggest that Microsoft have altered IE to specifically render an asp panel as a div - whereas it's natural, default state would be a table.

And if anyone thinks they slap an asp panel anywhere they want will find that half of their sites won't work in NN.

For the above reasons I have junked the asp panel and simply use a label - it renders as a span and creates no such problems.



4 Answers Found

Answer #1    Answered By: Arnelle Schmidt     Answered On: Dec 31

Your observation is an excellent one and I will probably look closely at using labels instead of the panel  control. However I did want to point out the obvious first, Netscape does indeed suck. I also realize that some are forced to write cross browser  compatible code and that sucks also.

My believe is that if all developers decided not to code for Netscape anymore then there would not be much support for it and it would just disappear. I also realize that there are some die hard Netscape fans out there, and I apologize. To continue to code for a browser that is no longer supported that maybe 15% of the market is using is insane. Please don’t write code for Netscape anymore and these wild, crazy problems  will vanish and we can all live in harmony with one browser.

Answer #2    Answered By: Cleopatra Massri     Answered On: Dec 31

In a situation like this, you can't really overlook the fact that NOTHING should be between a <tr> tag and the subsequent <td> (or <th>) tag; this is the way the w3c HTML standard works. Netscape, by not rendering anything that you put here, is following the standards, whereas IE is trying to show you something for your trouble, even if it ends up teaching poor coding practices.

All that to say that I don't know why a panel  renders as different elements in the two browsers... but you shouldn't be surprised at all if it doesn't show up correctly when you code it that way.

Answer #3    Answered By: Muntasir Bashara     Answered On: Dec 31

But - explain this then - the GotDotNetMenuSource example does a browser  check and pumps out downlevel code to NN7.
(NN7's browser version  is Netscape5 ... the example mentioned pumps out downlevel code to NN for anything < 6)

So it appears that IE's display property doesn't work  in NN ( as it didn't used to ) - but it DOES.

So NN ARE trying to keep up but they're always going to be at last a version behind unless MS tell 'em what their doing.

I'm not having a go at anyone, and have gotton used to being in the middle of and sorting out the big boys browser war. In fact I used to redirect NN users to the IE homepage - now I do my best to accommodate (if it's not too much trouble).

NN support built in MathML (for scientists and the maths lot) as well as SVG. IE doesn't sem to care a toss about minorities even if their as big as the whole of the science world - and even if the actual ActiveX control  that enables MathML in the browser is made by the same people who make Words Equation Editior :: i.e. you'de have thought they'de have thrown it into IE seeing as they have been dealing with the folks (dessci.com) for years.

Same goes for SVG.

I know these things will HAVE to be supportd when the standards are standardised - but NN do it now - all respect to them.

Answer #4    Answered By: Cadencia Bernard     Answered On: Dec 31

It's unfortunate. IE6 is technically downlevel in some areas where NS7 is uplevel... but good luck trying to get MS to admit that :) As it is, one supports the standards and the other supports some of the more neato features... but as you've pointed out, Netscape has some advantages in the coolness department. Too bad we can't get them to support a common VRML standard; now THAT would be fun.

Ah, the life of a web  developer; and to think that client-side development is one of my favorite areas! At least I don't need to pay a shrink to tell me how masochistic I am...

Didn't find what you were looking for? Find more on Asp : panel Or get search suggestion and latest updates.