Thursday, April 14, 2011

Problems with 'ScriptManager' namespace

If you are attempting to convert your existing Asp.net web application to an AJAX Enabled Asp.net web application, you most probably followed down the path of merging your existing web.config with one that is provided by a new Asp.net AJAX Enabled web application's web.config.

This worked fine for me until I tried adding a AutoCompleteExtender and needed to declare a method in code behind with the attributes


[System.Web.Services.WebMethodAttribute(),System.Web.Script.Services.ScriptMethodAttribute()]


That's when I came across the following error:


The type or namespace name 'ScriptManager' does not exist in the namespace 'System.Web.UI' (are you missing an assembly reference?)


Having merged the web.config files I assumed I should not be getting the error. However, what I had failed to do was merge the .csproj files. Apparently some references are in the .csproj file. Mainly, the reference to the System.Web.Extensions.

Adding a reference to the System.Web.Extensions should fix the problem.

No comments:

Post a Comment