RadDatePicker and Invalid XHTML

10 posts, 0 answers
  1. David Johnson
    David Johnson avatar
    11 posts
    Member since:
    Nov 2004

    Posted 11 Aug 2008 Link to this post

    Has anyone else noticed that the RadDatePicker control (and possibly other calendar related controls) produce invalid XHTML?

    The invalid XHTML comes from the <link> tags it produces for the skins - if I set enableembeddedskins to false, it validates fine. Has this problem been noted?
  2. Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 12 Aug 2008 Link to this post

    Hi Nath,

    I think I remember a similar problem causing invalid XHTML rendered by the Calendar control, but it has been addressed with the latest release. Please give the Q2 2008 version a try (ASP.NET AJAX version is labeled 2008.7.23) and let us know if you notice anything else.

    Please excuse us for the temporary inconvenience.

    All the best,
    Konstantin Petkov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. David Johnson
    David Johnson avatar
    3 posts
    Member since:
    Mar 2006

    Posted 13 Aug 2008 Link to this post

    Hi,

    I have updated to the Q2 release, however the calendar control is still producing invalid XHTML. Please advise.
  4. Dimo
    Admin
    Dimo avatar
    8478 posts

    Posted 14 Aug 2008 Link to this post

    Hello David,

    As far as I can see, the current official version of RadDatePicker produces valid XHTML. Please provide some more information :

    1) Which HTML validator do you use?
    2) What is the error?
    3) What is the control declaration, outputting invalid XHTML?


    By the way, the <link> tags are added to the page by a mechanism, which is used by all RadControls, so if a problem exists, it should be observed with all controls.


    Regards,
    Dimo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. David Johnson
    David Johnson avatar
    3 posts
    Member since:
    Mar 2006

    Posted 14 Aug 2008 Link to this post

    Hi,

    Thanks for the reply. Here are the answers:
    1) The W3C validator on validator.w3.org
    2) Error below, and as the W3C specification states: "The LINK element may only appear in the head of a document."
    3) This is the control declaration: <telerik:raddatepicker skin="Default2006" runat="server"/>






     Line 69, Column 238: document type does not allow element "link" here.

    …thQB7RVqQ01&amp;t=633523222800000000'></link><link class='Telerik_stylesheet'

    The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

    One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).

  6. Dimo
    Admin
    Dimo avatar
    8478 posts

    Posted 18 Aug 2008 Link to this post

    Hi David,

    You must add

    <head runat="server">


    Regards,
    Dimo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Erik Beyer
    Erik Beyer avatar
    8 posts
    Member since:
    Feb 2007

    Posted 18 Aug 2008 Link to this post

    I am facing the same issue. I already use runat="server" in the <head>. But still got the same error at validation like described.

    Regards
    Claudio
  8. Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 19 Aug 2008 Link to this post

    Hello Erik,

    Please upgrade to the latest Q2 2008 following the steps from this KB article and see if the problem persists. If you still need our assistance I will kindly ask you to submit a formal support ticket sending us an example, which replicates the issue. We will gladly look into it and get back to you with resolution.

    Regards,
    Konstantin Petkov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  9. Erik Beyer
    Erik Beyer avatar
    8 posts
    Member since:
    Feb 2007

    Posted 20 Aug 2008 Link to this post

    I just upgraded and still got the error by validating the page: See http://validator.w3.org/check?uri=www.gbase.ch&charset=(detect+automatically)&doctype=Inline&group=0
  10. Dimo
    Admin
    Dimo avatar
    8478 posts

    Posted 21 Aug 2008 Link to this post

    Hi Erik,

    All RadControls for ASP.NET AJAX are XHTML-compliant. If you want to use them with a HTML doctype and validate your markup, please refer to:

    How to Use RadControls for ASP.NET AJAX Embedded Skins with an HTML DOCTYPE


    Another (more complex) solution would be to set EnableEmbeddedSkins="false" and register the CSS files manually. You can find the non-embedded versions of all skins in the /Skins/ subfolder of your RadControls installation.

    Let us know if you need more information.

    RadControls for ASP.NET AJAX - Skin Registration


    Best wishes,
    Dimo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top