ASP.net project migration issue with ASP.net Ajax. Solution : xhtmlConformance in web.config

Few days back I was stuck with this, and after struggling for few days, doing google for all possible reasons, I found the issue was in web.config file.

There was a “xhtmlConformance” tag, which was generated while migrating the project to ASP.Net 2.0.

   

       

   

When we use the VS 2003 -> VS 2005 Web Project Migration Wizard (for both web sites and web application projects), the web.config file will have the legacy switch added. It gets added for backward compatibility.

This tag allows developers to render controls in “Legacy” mode (non-XHTML markup for ASP.NET 1.1) as well as Transitional mode (XHTML Transitional) and Strict mode (XHTML Strict).

This default addition of tag  was the culprit for improper functioning of Ajax.

To fix this

You need to remove that tag itself or set it to”Transitional” or “Strict“. That makes the Ajax controls working.

   

       

   

One additional benefit that you get from here onward is, it makes any new control XHTML standards compliant.  e.g. HTML generated from your server controls to be “well formed”(open and close tag elements always match).

150 150 Burnignorance | Where Minds Meet And Sparks Fly!