ASP.NET Ajax : Javascript Problems with Migrated Legacy Projects - try the xhtmlConformance Spell!

If you have migrated an old project from ASP.NET 1.1 to 2.0 and subsequently changed the Web.config according to , but still not getting Ajax to work and JavaScript errors keep popping up, xhtmlConformance might just be the missing piece in the jigsaw!! Try looking for the following setting -


        < xhtmlConformance mode= "Legacy" />


Either get rid of that at once, or set it to "Transitional" or "Strict"!! This is evil, and is always automatically appended to the Web.config after migration!!

Here are the steps we did, and even after that we kept getting the issue. Only after removing xhtmlConformance , we got it to work.


    ASP.NET AJAX Extensions and ASP.NET AJAX Control Toolkit in the development

    a reference to System.Web.Extensions to the project

    the Web.config as per all the steps mentioned at

    a ScriptManager control to the master page outside the ContentPlaceholder as

  •  <asp:ScriptManager
    ID="ScriptMgr1" runat="server"

  • <asp:ContentPlaceHolder

    a UpdatePanel in a Content page surrounding a GridView and registered the
    button’s (which refreshes the GridView based on drop-down filters) Click event
    in the list of Triggers for the UpdatePanel as AsyncPostBackTrigger. The
    UpdateMode property of the UpdatePanel is set to Conditional.

  •   Even
    after this, when the Website is run and the button is clicked , it was
    refreshing the page with postback as before
    . We cannot figure out what is
    going on and why is Ajax not working on the site.

  •   We
    even tried having the button inside the UpdatePanel and set ChildrenAsTriggers
    to true with same results.


Thanks to the greatest Wizard, Scott, once again!!