Home/ASP.NET Forums/General ASP.NET/Getting Started/My site runs with 723 errors - how?

My site runs with 723 errors - how? [Answered]RSS

20 replies

Last post Mar 17, 2008 09:14 PM by ClayShannon

Clay Shannon
www.lulu.com/blackbirdcraven
www.bclayshannon.photoshop.com
  • Mr^B

    Mr^B

    Star

    12726 Points

    2245 Posts

    Re: My site runs with 723 errors - how?

    Mar 17, 2008 02:54 PM|Mr^B|LINK

    To fix them, just read them and do as they suggest.

    1. You can't use meta tags where you are trying to use them

    2. You have images without alt tags on them

    3. It looks like your document isn't well-formed, it looks like you're missing a <body> tag

    4. don't use < characters for display or comments, the < and > characters are VERY specific to html and you shouldn't use them directly.


     

    MCSD.Net
  • ClayShannon

    ClayShannon

    Member

    683 Points

    1164 Posts

    Re: My site runs with 723 errors - how?

    Mar 17, 2008 03:50 PM|ClayShannon|LINK

    Mr^B

    To fix them, just read them and do as they suggest.

    OK, I removed the comment and meta tag, and now it says I have 3 errors.

    Mr^B

    1. You can't use meta tags where you are trying to use them

    So where can I use them? I added that meta tag based on a "best practices" list of suggestions; I guess it didn't say just where to place the meta tag.

    Mr^B

    2. You have images without alt tags on them

    Where is the alt tag supposed to go? Can someone provide an example of one?

    Mr^B

    3. It looks like your document isn't well-formed, it looks like you're missing a <body> tag

    It does have a <body> tag:

    . . .
    </head>

    <body>
    . . .
    </form>
        </body>
    </html>

    Mr^B

    4. don't use < characters for display or comments, the < and > characters are VERY specific to html and you shouldn't use them directly.

    So what is the correct format for comments? Based on a code snippet I found somewhere, I thought it was: <! . . .>

    Anyway, here are the 3 errors I am down to now. As to the first one, I have no such html as they quote below in my raw html. This is automatically generated by the browser, I guess, so I don't know how to change / fix something the browser itself is doing.

    1. Error Line 86, Column 229: required attribute "alt" not specified.

      …d" src="" style="border-width:0px;" /></span></td>

      <div class="ve mid-127">

      The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

      Typical values for

      type
      are
      type="text/css"
      for
      <style>
      and
      type="text/javascript"
      for
      <script>
      .

      </div>
    2. Error Line 141, Column 98: required attribute "alt" not specified.
      …ner2.PNG" style="border-width:0px;" />

      <div class="ve mid-127">

      The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

      Typical values for

      type
      are
      type="text/css"
      for
      <style>
      and
      type="text/javascript"
      for
      <script>
      .

      </div>
    3. Error Line 166, Column 36: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag.
                                      <div>

    Clay Shannon
    www.lulu.com/blackbirdcraven
    www.bclayshannon.photoshop.com
  • ClayShannon

    ClayShannon

    Member

    683 Points

    1164 Posts

    Re: My site runs with 723 errors - how?

    Mar 17, 2008 04:12 PM|ClayShannon|LINK

    ClayShannon

    Error Line 166, Column 36: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag.

    1.                                 <div>

    In the error above, the html being generated by the browser is:

    <p style="font-family: Garamond; font-size: larger; background-color: #FFFFFF; border-style: groove">
    The current top 10 scorers are:
    <div>

    The err msg references the <div> being invalid--OK, however I didn't put it there! My html is:

    <p style="font-family: Garamond; font-size: larger; background-color: #FFFFFF; border-style: groove">
    The current top 10 scorers are:
    <asp:GridView ID="GridView_View1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource_View1"
    . . .
    </asp:GridView>

    So what can I do to prevent the browser from outputting this <div> that is apparently invalid? I did have a <br/> there, and removed it, with no apparent change one way or the other.

    Clay Shannon
    www.lulu.com/blackbirdcraven
    www.bclayshannon.photoshop.com
  • ClayShannon

    ClayShannon

    Member

    683 Points

    1164 Posts

    Re: My site runs with 723 errors - how?

    Mar 17, 2008 04:45 PM|ClayShannon|LINK

    ClayShannon

    Where is the alt tag supposed to go? Can someone provide an example of one?

    OK, I did this, and validator no longer complains about it, so I guess it's alright:

    <asp:Image ID="Image1" runat="server" ImageUrl="~/SiteBanner2.PNG" alt="Site Banner" />

    <asp:Image ID="Image1" runat="server" ImageUrl="~/SiteBanner2.PNG" alt="Site Banner" />p:Image ID="Image1" runat="server" ImageUrl="~/SiteBanner2.PNG" alt="Site Banner" />

    Clay Shannon
    www.lulu.com/blackbirdcraven
    www.bclayshannon.photoshop.com
  • naimulah

    naimulah

    Member

    52 Points

    25 Posts

    Re: My site runs with 723 errors - how?

    Mar 17, 2008 05:06 PM|naimulah|LINK

    <asp:Image AlternateText="alt text goes here" />

  • anthonypj

    anthonypj

    Participant

    1158 Points

    278 Posts

    Re: My site runs with 723 errors - how?

    Mar 17, 2008 08:32 PM|anthonypj|LINK

    well looks like asp.net defualt genrates a div tag when rendering the girdview control , so do not place inside <p></p> tags rather place the girdview control outside your <p></p> tags ... are you using css adapters with your gridview control ?

     

  • DarthSwian

    DarthSwian

    Star

    14368 Points

    2674 Posts

    Re: My site runs with 723 errors - how?

    Mar 17, 2008 08:57 PM|DarthSwian|LINK

     The div is generated by the gridview.

     I would not get so crazy about the WC3 errors. .Net generates html code for a lot of the elements and the WC3 will not like the code generated. Try the site in IE and Firefox and any others you feel will be used to visit your site. If you have only a few minor errors and it displays fine, you don't need to pull your hair out.
     

    Mark as answer if I helped.

    Seek and ye shall find or http://lmgtfy.com/
  • ClayShannon

    ClayShannon

    Member

    683 Points

    1164 Posts

    Re: My site runs with 723 errors - how?

    Mar 17, 2008 09:13 PM|ClayShannon|LINK

    anthonypj

    well looks like asp.net defualt genrates a div tag when rendering the girdview control , so do not place inside <p></p> tags rather place the girdview control outside your <p></p> tags ... are you using css adapters with your gridview control ?

    Great, stripping out the paragraph tags in question solved it. My html now validates as fully compliant.

    Clay Shannon
    www.lulu.com/blackbirdcraven
    www.bclayshannon.photoshop.com
  • ClayShannon

    ClayShannon

    Member

    683 Points

    1164 Posts

    Re: My site runs with 723 errors - how?

    Mar 17, 2008 09:14 PM|ClayShannon|LINK

    DarthSwian

     The div is generated by the gridview.

     I would not get so crazy about the WC3 errors. .Net generates html code for a lot of the elements and the WC3 will not like the code generated. Try the site in IE and Firefox and any others you feel will be used to visit your site. If you have only a few minor errors and it displays fine, you don't need to pull your hair out.
     

    That's basically the way I was looking at it, too, but I would much rather have it validate fully (which it now does) than otherwise. You (all) might be interested in this discussion of the web standards issue (the "Martian Headsets" article/blog):

    http://www.joelonsoftware.com/

    Clay Shannon
    www.lulu.com/blackbirdcraven
    www.bclayshannon.photoshop.com
  • ‹ Previous Thread|Next Thread ›