views:

66

answers:

3

We have an ASP.NET 2.0 WebForms app that uses MS Ajax 1.0. It's working fine on all our environments (dev, test, IE6 VMs etc.). However, at the customer site the client side validation is not happening.

We're currently trying to eliminate all the various factors and along the way we asked them to get their page source and send it to us, and we found something interesting.

In our environment, our page has ASP.NET javascript in CDATA blocks:

<script type="text/javascript">
//<![CDATA[
. . .
//]]>
</script>

In their environment, the same code looks like this:

<script type="text/javascript">
<!--
. . .
//-->
</script>

This may be a red herring, but I'd like to eliminate it as the cause of the validation issues.

Does anyone know whether specific configurations/patches/versions of ASP.NET will make it do this?

+2  A: 

It might have to do with how (or whether) the pages are being rendered as XHTML. In the web.config, look for a xhtmlConformance element. In your examples, the version in your environment would be proper usage in xhtml, but the version in their environment looks like legacy HTML, not xhtml.

JacobM
+1  A: 

Check to see whether the machine.config on the deployment machine is set thusly:

<xhtmlConformance mode="Transitional" />

It may be set to 'legacy' instead.

LesterDove
(Really just a variation on JacobM's answer. Thanks!)
LesterDove
+1  A: 

While adding the following line to my app's web.config did stop the JavaScript from being rendered in blocks, it didn't fix the validation issue.

<xhtmlConformance mode="Transitional" />

What did fix the validation issue was installing .NET 2.0 Server Pack 2 on the server. It seems that using s from the MS Ajax 1.0 library on .NET 2.0 can break your s unless you install SP2.

d4nt