Problem with w3c validator in script definition of doPostBack

Discussion in 'ASP .Net' started by Alfonso Alvarez, May 12, 2004.

  1. Hi:
    I'm doing a web page using asp.net and framework 1.1. When I upload the
    page to server and try it with html validator of w3c, trying with html 4.01
    an xhtml 1.0, I receive an error in the script definition of __doPostBack
    method because de element type is not defined. This script is automatically
    generated by the compiler or by the server.
    I used the same page into an IIS over windows XP and generates correct
    code (script with element type). The problem becomes when I use the page
    into an IIS over windows 2003, the script generated in that case not
    includes the element type. The framework of both versions are the same:
    1.1.4322.
    Is there any way to configure this definition?

    It must be:
    <script language="javascript" type="text/javascript">
    ---------------------
    <!--
    function __doPostBack(eventTarget, eventArgument) {
    var theform;
    if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
    theform = document.Form1;
    }
    else {
    theform = document.forms["Form1"];
    }
    theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
    theform.__EVENTARGUMENT.value = eventArgument;
    theform.submit();
    }
    // -->
    </script>


    and IIS on Windows 2003 generates:

    <script language="javascript">
    <!--
    function __doPostBack(eventTarget, eventArgument) {
    var theform;
    if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
    theform = document.forms["Form1"];
    }
    else {
    theform = document.Form1;
    }
    theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
    theform.__EVENTARGUMENT.value = eventArgument;
    theform.submit();
    }
    // -->
    </script>



    Lot of thanks
    Alfonso Alvarez Pérez
     
    Alfonso Alvarez, May 12, 2004
    #1
    1. Advertising

  2. Alfonso Alvarez

    bruce barker Guest

    its actually worse, the hidden fields:

    __EVENTTARGET
    __EVENTARGUMENT

    are not legal element id's or names.

    -- bruce (sqlwork.com)




    "Alfonso Alvarez" <> wrote in message
    news:ucv7#...
    > Hi:
    > I'm doing a web page using asp.net and framework 1.1. When I upload

    the
    > page to server and try it with html validator of w3c, trying with html

    4.01
    > an xhtml 1.0, I receive an error in the script definition of __doPostBack
    > method because de element type is not defined. This script is

    automatically
    > generated by the compiler or by the server.
    > I used the same page into an IIS over windows XP and generates correct
    > code (script with element type). The problem becomes when I use the page
    > into an IIS over windows 2003, the script generated in that case not
    > includes the element type. The framework of both versions are the same:
    > 1.1.4322.
    > Is there any way to configure this definition?
    >
    > It must be:
    > <script language="javascript" type="text/javascript">
    > ---------------------
    > <!--
    > function __doPostBack(eventTarget, eventArgument) {
    > var theform;
    > if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1) {
    > theform = document.Form1;
    > }
    > else {
    > theform = document.forms["Form1"];
    > }
    > theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
    > theform.__EVENTARGUMENT.value = eventArgument;
    > theform.submit();
    > }
    > // -->
    > </script>
    >
    >
    > and IIS on Windows 2003 generates:
    >
    > <script language="javascript">
    > <!--
    > function __doPostBack(eventTarget, eventArgument) {
    > var theform;
    > if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
    > theform = document.forms["Form1"];
    > }
    > else {
    > theform = document.Form1;
    > }
    > theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
    > theform.__EVENTARGUMENT.value = eventArgument;
    > theform.submit();
    > }
    > // -->
    > </script>
    >
    >
    >
    > Lot of thanks
    > Alfonso Alvarez Pérez
    >
    >
     
    bruce barker, May 12, 2004
    #2
    1. Advertising

  3. Hi:
    I don't understand your response. My problem (by now) is not this
    fields. The problem becomes before in de script definition.
    Anyway, this fields are created by server into the html page that
    returns.
    Thanks
    Alfonso Alvarez

    "bruce barker" <> escribió en el mensaje
    news:...
    > its actually worse, the hidden fields:
    >
    > __EVENTTARGET
    > __EVENTARGUMENT
    >
    > are not legal element id's or names.
    >
    > -- bruce (sqlwork.com)
    >
    >
    >
    >
    > "Alfonso Alvarez" <> wrote in message
    > news:ucv7#...
    > > Hi:
    > > I'm doing a web page using asp.net and framework 1.1. When I upload

    > the
    > > page to server and try it with html validator of w3c, trying with html

    > 4.01
    > > an xhtml 1.0, I receive an error in the script definition of

    __doPostBack
    > > method because de element type is not defined. This script is

    > automatically
    > > generated by the compiler or by the server.
    > > I used the same page into an IIS over windows XP and generates

    correct
    > > code (script with element type). The problem becomes when I use the page
    > > into an IIS over windows 2003, the script generated in that case not
    > > includes the element type. The framework of both versions are the same:
    > > 1.1.4322.
    > > Is there any way to configure this definition?
    > >
    > > It must be:
    > > <script language="javascript" type="text/javascript">
    > > ---------------------
    > > <!--
    > > function __doPostBack(eventTarget, eventArgument) {
    > > var theform;
    > > if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1)

    {
    > > theform = document.Form1;
    > > }
    > > else {
    > > theform = document.forms["Form1"];
    > > }
    > > theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
    > > theform.__EVENTARGUMENT.value = eventArgument;
    > > theform.submit();
    > > }
    > > // -->
    > > </script>
    > >
    > >
    > > and IIS on Windows 2003 generates:
    > >
    > > <script language="javascript">
    > > <!--
    > > function __doPostBack(eventTarget, eventArgument) {
    > > var theform;
    > > if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
    > > theform = document.forms["Form1"];
    > > }
    > > else {
    > > theform = document.Form1;
    > > }
    > > theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
    > > theform.__EVENTARGUMENT.value = eventArgument;
    > > theform.submit();
    > > }
    > > // -->
    > > </script>
    > >
    > >
    > >
    > > Lot of thanks
    > > Alfonso Alvarez Pérez
    > >
    > >

    >
    >
     
    Alfonso Alvarez, May 13, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. xeno

    W3C Validator

    xeno, Jun 27, 2003, in forum: HTML
    Replies:
    1
    Views:
    986
    Hywel Jenkins
    Jun 28, 2003
  2. Paul Blay
    Replies:
    6
    Views:
    515
    Toby A Inkster
    Dec 9, 2003
  3. David Dorward
    Replies:
    0
    Views:
    344
    David Dorward
    Apr 16, 2004
  4. Frank
    Replies:
    9
    Views:
    1,631
    David Dorward
    May 3, 2004
  5. muchan
    Replies:
    3
    Views:
    743
    muchan
    Jul 13, 2004
Loading...

Share This Page