Problem with w3c validator in script definition of doPostBack

A

Alfonso Alvarez

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
 
B

bruce barker

its actually worse, the hidden fields:

__EVENTTARGET
__EVENTARGUMENT

are not legal element id's or names.

-- bruce (sqlwork.com)
 
A

Alfonso Alvarez

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 said:
its actually worse, the hidden fields:

__EVENTTARGET
__EVENTARGUMENT

are not legal element id's or names.

-- bruce (sqlwork.com)




Alfonso Alvarez said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,068
Latest member
MakersCBDIngredients

Latest Threads

Top