SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Evangelist
    Join Date
    Dec 2004
    Posts
    419
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Shame about the Validation...

    I'm just starting out learning ASP.NET via the SitePoint ASP.NET 2.0 book.

    One thing that is disappointing is to find that the out-the-box .NET functionality doesn't generate valid XHTML.

    I know that I'm probably being really anal and nerdy about that, but it does seem a shame that what feels like a really powerful scripting platform doesn't create valid html, considering how there has been such a drive in recent years by people to try to make their websites validate, and be as accessible as possible.

    Like I say, not the end of the world, but I was disappointed to find this. Seems like there are workarounds out there.

    Did this put anyone else off? Like I say, please forgive me for my anal tendencies...

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,638
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Not sure where you get your facts from, but .NET 2.0 generates valid XHTML Transitional.

    As for accessibility, some mythical sacrifice to a validation goddess has little or nothing to do with it. Solid planning and testing usually helps.

  3. #3
    SitePoint Evangelist
    Join Date
    Dec 2004
    Posts
    419
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry, I was using XHTML Strict.
    My apologies - like I said, I am being anal, and talking crap. Sorry.

  4. #4
    SitePoint Wizard
    Join Date
    Feb 2007
    Posts
    1,274
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ^^^^ what wwb said.

    If you want to be anal (and that is ok from time to time so no offense taken), I personally find that the default XHTML generated by some of the built-in controls is sub-standard. Take the menu or the login control. They will generate valid XHTML, but use a table based layout. yikes.

    MS has since published an add-on (which uses a built-in feature called control adapters with which you can completely take over the rendering of a control) which adapts all of these controls to render css based layouts.

  5. #5
    SitePoint Addict inverse.chi's Avatar
    Join Date
    May 2006
    Location
    Oxford, UK | Durham, UK
    Posts
    243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    honeymonster, are you refering to the CSS Friendly Adaptors? which can be found here :http://www.asp.net/cssadapters/
    Malachi Soord
    Something will come here

  6. #6
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,638
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I think he was.

    I should note that, especially for public facing sites, we have been doing very standards oriented, CSS-driven layouts since the dark days of 1.1. There are alot of ways to keep the framework from generating bloated html.

  7. #7
    Chopped Liver bronze trophy imaginekitty's Avatar
    Join Date
    Aug 2007
    Location
    Pennsyltucky
    Posts
    1,494
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by wwb_99 View Post
    I think he was.

    I should note that, especially for public facing sites, we have been doing very standards oriented, CSS-driven layouts since the dark days of 1.1. There are alot of ways to keep the framework from generating bloated html.
    Sorry to bring up an old thread but I would really like more information on the ways to keep the framework from generating bloated code.

    Valid code isn't always semantic code and I'd rather not build new pages against a transitional doctype. Transitional is for updated pages. It would be better to use HTML 4.01 Strict than XHTML 1 Transitional.

  8. #8
    Chopped Liver bronze trophy imaginekitty's Avatar
    Join Date
    Aug 2007
    Location
    Pennsyltucky
    Posts
    1,494
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    In reply to the original post even though it is so old, I've discovered that you can cause ASP.NET to create valid pages by adding this to the web.config file:
    Code:
         <xhtmlConformance 
            mode="Strict" />
    It still bloats the code a bit by throwing javascript in everywhere so that's my next adventure.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •