asp:form generates invalid code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vaclav Jedlicka

    #1

    asp:form generates invalid code

    Hi all

    The code generated by the server side control asp:form generates invalid
    code. The HTML tag FORM always contains attribute "name".

    When I validate the page with the online validator
    (http://www.htmlhelp.com/tools/validator/direct.html) it says that:

    <form name="browse" method="post" action="browse_ employees.a ...
    ^Error: there is no attribute NAME for this element (in this HTML
    version)



    How can I prevent asp:form from generating this attribute?



    Thanks in advance

    Vaclav Jedlicka


  • George Ter-Saakov

    #2
    Re: asp:form generates invalid code

    Just validated the following HTML

    ---------------------------
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>

    <title></title>

    </head>
    <body>
    <form name="Asd" action="asd"></form>

    </body>
    </html>

    -----------------------------------

    It did not complain that <form> has a name.

    George.


    "Vaclav Jedlicka" <vjedlicka@iol. cz> wrote in message
    news:%23KtzJzEU DHA.560@TK2MSFT NGP10.phx.gbl.. .[color=blue]
    > Hi all
    >
    > The code generated by the server side control asp:form generates invalid
    > code. The HTML tag FORM always contains attribute "name".
    >
    > When I validate the page with the online validator
    > (http://www.htmlhelp.com/tools/validator/direct.html) it says that:
    >
    > <form name="browse" method="post" action="browse_ employees.a ...
    > ^Error: there is no attribute NAME for this element (in this[/color]
    HTML[color=blue]
    > version)
    >
    >
    >
    > How can I prevent asp:form from generating this attribute?
    >
    >
    >
    > Thanks in advance
    >
    > Vaclav Jedlicka
    >
    >[/color]


    Comment

    • Vaclav Jedlicka

      #3
      Re: asp:form generates invalid code

      Thanks

      You use HTML 4.01, I used 4.0, that is why I had the problem. I can fix my
      problem by using version 4.01.

      May I have another question? I am havening this problem with the validator
      (even with HTML 4.01). The SCRIPT tag is generated by ASP.NET

      <script language="javas cript">
      ^Error: required attribute TYPE not specified









      "George Ter-Saakov" <we@hotmail.com > wrote in message
      news:%23AbGtPFU DHA.1552@TK2MSF TNGP10.phx.gbl. ..[color=blue]
      > Just validated the following HTML
      >
      > ---------------------------
      > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      > "http://www.w3.org/TR/html4/loose.dtd">
      > <html>
      > <head>
      >
      > <title></title>
      >
      > </head>
      > <body>
      > <form name="Asd" action="asd"></form>
      >
      > </body>
      > </html>
      >
      > -----------------------------------
      >
      > It did not complain that <form> has a name.
      >
      > George.
      >
      >
      > "Vaclav Jedlicka" <vjedlicka@iol. cz> wrote in message
      > news:%23KtzJzEU DHA.560@TK2MSFT NGP10.phx.gbl.. .[color=green]
      > > Hi all
      > >
      > > The code generated by the server side control asp:form generates invalid
      > > code. The HTML tag FORM always contains attribute "name".
      > >
      > > When I validate the page with the online validator
      > > (http://www.htmlhelp.com/tools/validator/direct.html) it says that:
      > >
      > > <form name="browse" method="post" action="browse_ employees.a ...
      > > ^Error: there is no attribute NAME for this element (in this[/color]
      > HTML[color=green]
      > > version)
      > >
      > >
      > >
      > > How can I prevent asp:form from generating this attribute?
      > >
      > >
      > >
      > > Thanks in advance
      > >
      > > Vaclav Jedlicka
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • George Ter-Saakov

        #4
        Re: asp:form generates invalid code

        Why would you care about all that?
        There are about 95% of IE out there and a handful of other browsers.
        I do knot know even one browser that requires to have TYPE.



        George.

        "Vaclav Jedlicka" <vjedlicka@iol. cz> wrote in message
        news:%23jyLthFU DHA.2264@TK2MSF TNGP11.phx.gbl. ..[color=blue]
        > Thanks
        >
        > You use HTML 4.01, I used 4.0, that is why I had the problem. I can fix my
        > problem by using version 4.01.
        >
        > May I have another question? I am havening this problem with the validator
        > (even with HTML 4.01). The SCRIPT tag is generated by ASP.NET
        >
        > <script language="javas cript">
        > ^Error: required attribute TYPE not specified
        >
        >
        >[/color]


        Comment

        • Vaclav Jedlicka

          #5
          Re: asp:form generates invalid code

          Because some customers request valid HTML code.

          "George Ter-Saakov" <we@hotmail.com > wrote in message
          news:u742h2FUDH A.1868@TK2MSFTN GP11.phx.gbl...[color=blue]
          > Why would you care about all that?
          > There are about 95% of IE out there and a handful of other browsers.
          > I do knot know even one browser that requires to have TYPE.
          >
          >
          >
          > George.
          >
          > "Vaclav Jedlicka" <vjedlicka@iol. cz> wrote in message
          > news:%23jyLthFU DHA.2264@TK2MSF TNGP11.phx.gbl. ..[color=green]
          > > Thanks
          > >
          > > You use HTML 4.01, I used 4.0, that is why I had the problem. I can fix[/color][/color]
          my[color=blue][color=green]
          > > problem by using version 4.01.
          > >
          > > May I have another question? I am havening this problem with the[/color][/color]
          validator[color=blue][color=green]
          > > (even with HTML 4.01). The SCRIPT tag is generated by ASP.NET
          > >
          > > <script language="javas cript">
          > > ^Error: required attribute TYPE not[/color][/color]
          specified[color=blue][color=green]
          > >
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • John Saunders

            #6
            Re: asp:form generates invalid code

            Interesting. I haven't met any customers like this. I hope they also request
            that the application works...

            --
            John Saunders
            Internet Engineer
            john.saunders@s urfcontrol.com


            "Vaclav Jedlicka" <vjedlicka@iol. cz> wrote in message
            news:erafBiOUDH A.1324@TK2MSFTN GP11.phx.gbl...[color=blue]
            > Because some customers request valid HTML code.
            >
            > "George Ter-Saakov" <we@hotmail.com > wrote in message
            > news:u742h2FUDH A.1868@TK2MSFTN GP11.phx.gbl...[color=green]
            > > Why would you care about all that?
            > > There are about 95% of IE out there and a handful of other browsers.
            > > I do knot know even one browser that requires to have TYPE.
            > >
            > >
            > >
            > > George.
            > >
            > > "Vaclav Jedlicka" <vjedlicka@iol. cz> wrote in message
            > > news:%23jyLthFU DHA.2264@TK2MSF TNGP11.phx.gbl. ..[color=darkred]
            > > > Thanks
            > > >
            > > > You use HTML 4.01, I used 4.0, that is why I had the problem. I can[/color][/color][/color]
            fix[color=blue]
            > my[color=green][color=darkred]
            > > > problem by using version 4.01.
            > > >
            > > > May I have another question? I am havening this problem with the[/color][/color]
            > validator[color=green][color=darkred]
            > > > (even with HTML 4.01). The SCRIPT tag is generated by ASP.NET
            > > >
            > > > <script language="javas cript">
            > > > ^Error: required attribute TYPE not[/color][/color]
            > specified[color=green][color=darkred]
            > > >
            > > >
            > > >[/color]
            > >
            > >[/color]
            >
            >[/color]


            Comment

            • Tian Min Huang

              #7
              Re: asp:form generates invalid code

              Hello Vaclav,

              I just did a quick search and found that it is a known issue. It seems
              you're out of luck. The RenderPostBackS cript method implemented in the Page
              class is declared as
              private and it has the "<script language="javas cript"> string hard-coded
              into it. Also there are other methods that will output the script tag this
              way so as a quick and workaround you could override the rendering of the
              Page and do a search & replace operation (<script language="javas cript">
              ----> <script type="text/javascript">) before rendering the contents.

              Please feel free to let me know if you have any problems or concerns.

              Have a nice day!

              Regards,

              HuangTM
              Microsoft Online Partner Support
              MCSE/MCSD

              Get Secure! ¨C www.microsoft.com/security
              This posting is provided ¡°as is¡± with no warranties and confers no rights.


              Comment

              Working...