Posted By: miies | Apr 8th, 2004 @ 1:55 AM
page 1 of 1
Comments: 18 | Views: 6921
Well not much actually Wink

There's imho one major flaw I'm currently experiencing and that is the lack of advanced CSS support. I'll explain with an example.

In classic ASP, when I want to build a list I do this:

<table class="list">
<tr class="list">
   <th class="list"></th>
</tr>
<tr class="list">
   <td class="list"></td>
</tr>
</table>

or

<div id="list">
<table>
<tr>
   <th></th>
</tr>
<tr>
   <td></td>
</tr>
</table>
</div>

I am a strong supporter of using CSS for storing as much design as possible. My HTML pages contain the 'skeleton' of the list while my CSS file contains the complete design. This works like a charm - by modifying the CSS, every list on every page in my site uses the new design. I hate using deprecated HTML attributes like border, cellspacing, etc. because almost every one of them is covered by CSS. The last couple of years, web development has slowly begun to evolve like this.

Now I'm using .NET so of course I want to use the very nifty DataGrid control. The problem is, these controls send you right back into the HTML stone age by applying the same old HTML attributes I mentioned above. Oh of course, I can disable most of them and apply CssClass properties, but CssClass is treated as an additional property, not as the container for all visual attributes. The result is an HTML fragment with HTML attributes (cellpadding="0"AND a CSS class (class="list"AND CSS style attributes (style="blah"). Looks like crap.

Imho, when using a web control you should be given the choice:

1) Use HTML attributes
2) Use class=""
3) Use class="" and/or style=""

But never a combination of all. You could (very) slowly phase out option #1 to please webdesigners who are still using classic HTML.

For now, I'l stick to disabling as much datagrid properties as possible (why do the CellSpacing and CellPadding properties accept a -1 value and BorderWith does not?).

Sorry for the lengthy post. I hope this explains my troubles a little, that CSS will play a more important role in future releases/updates, and that I haven't bored you all with this rant. Smiley

Cheers.
Absolutely! This is one thing which has always annoyed me. I'm glad someone brought this up for discussion.

Yes! I'd particularly like to see more support for external stylesheets (.css) files.

I hate adding a link tag to every page. Although, I am admittedly very laZy. Smiley

Isn't XHTML/CSS compliance a feature in Whidbey?

Not sure on the Whidbey support but do hope it's an area that really gets a lift.

Suppose most developers use Visual Studio as their GUI and what really annoys me are these active schemas...just doesn't make any sense that you can't nest a form within a table cell?!?!!? or a list (li) inside a table cell.

nevertheless, was a bit off-topic but on the CSS front you get 100 warnings if you include your css file within your project/solution - eventhough everything looks ok through most browsers.

Why wouldn't you use an ordered or unordered list?  Why wouldn't classic ASP output an ordered or unordered list?  List elements are just as easily styled as table elements and would allow you to maintain the document's semantic integrity.

Obviously I'm not an ASP developer, but this tidbit just stuns me.  What were they thinking?

I suppose I shouldn't be surprised considering the main Microsoft home page doesn't even delcare a DOCTYPE.  I think a few people in Microsoft may be due for some remedial HTML training.


I totally agree with this, I've been coding in ASP3.0 for quite a few years, and now after developing desktop apps in .NET I have finally began to venture into ASP.NET.  The way it acts when you try to include files, or do more complex HTML stuff makes it very annoying to try and use the new neat stuff like the datagrid. Sad
XSiVE, you're really only complaining about Visual Studio .NET

I agree and wish the dg (in fact all controls) was stripped of all style attributes by default but I wonder why so many people always are using the dg (and datasets) when they are overkill for many things (on the web). I may use it for simple add/edit/deletes on tables but that’s about it. I always stick with repeaters as much as possible.

 It is interesting to always read about 2.0 and Whidbey and how it will change the world. I wish I could be impressed but it doesn’t help those who currently work with 1.1 for a living. Its kind of like..ok what you have now is crap but in 2.0 it will be fixed....well I don’t know about others but its not like we will flip a switch and move to 2.0. It seems the only fix is to buy controls that other people have developed, which kind of sucks cause they are just building something that should of been done right in the first place.

Are you using guys using the design viewer in vs.net? I would strongly advise against it and run for the hills. The first thing to do in every web project is right-click==>open with==>Source Code - Text Editor. 

Sorry for the OT but guess I am a little bit of a disgruntled .net developer.

Here's my css question.  I'm developing a WebControl, and I want to be able to a) use a style sheet to control apperances, and b) have the user override my defaults with their own style sheet.

Is this possible?  Since this is a WebControl, I don't have access to the ASPX page's <head>, where I would link in my own style sheet.  Is there another way to reference a style sheet?

I want to use a style sheet for my own default for the same reason that I want the user to be able to use one-- it's 100x easier than fiddling with object properties.

Idealy, I would publish some documentation that says "to override the default apperances for WebControl FOO, create a stylesheet with class BAR, and link it in your ASPX page head".  Would this even work?

Perhaps if you used inline styles - but I'd recommend just rendering a plain looking web control and possibly extend the designer to do some "auto formatting" like the DataGrid does. Anything else wouldn't match the paradigm of the rest of the controls and I think you'd constantly run into problems like how the control appears in the designer.

JChung2006 wrote:


Gaaaaaahh! What possible reason did you have to necrobump this thread all the way from 2004?
addexm wrote:

I hate adding a link tag to every page. Although, I am admittedly very laZy. Smiley



riiight ... so why aren't you using Themes? A good book on asp.net would teach you how to avoid these common mistakes ....
Now that's weird.  There was another reply before mine that was dated today, but it's gone now. typemismatch, the original post was dated 2004, which was before .NET 2.0 and ASP.NET Themes were available. My apologies for bumping this very old thread.
JChung2006 wrote:
Now that's weird.  There was another reply before mine that was dated today, but it's gone now. typemismatch, the original post was dated 2004, which was before .NET 2.0 and ASP.NET Themes were available. My apologies for bumping this very old thread.


Bizarre.
evildictaitor wrote:

JChung2006 wrote: Now that's weird.  There was another reply before mine that was dated today, but it's gone now. typemismatch, the original post was dated 2004, which was before .NET 2.0 and ASP.NET Themes were available. My apologies for bumping this very old thread.


Bizarre.


Blehbleh (now banned) ressurected the thread and posted some crap, PaoloM then deleted it, but the "last reply date" was unchanged so it appeared on the front page.

But yeah, control adapters ftw. I've made my markup so much cleaner with them. Thing is, you can only really use them with Reflector to get the rendering just right. You have to use Reflection to access some internal properties sometimes though, like for my overriden behaviour for HtmlHead I needed to access an internal IStyleSheet property.