Error: The type or namespace name ‘xxx’ could not be found

Today I ran into a small programming related issue. As I was working on a webpart, I was trying to use an UpdatePanel control. So I referenced the System.Web and added the using statements:

  • using System.Web;
  • using System.Web.UI;

But still got me the nasty The type or namespace name ‘UpdatePanel’ could not be found (are you missing a using directive or an assembly reference?) 

Well of course not I added all the needed directives and assemblies. Or didn’t I?

UpdatePanel is an extension, it used to be in the Atlas library which later became Ajax.NET so don’t forget to also reference System.Web.Extensions. This should solve your problems. As it is plain .NET code it is something that works in SharePoint as well as other .NET applications.

Can be a tricky little thing, and of course it doesn’t only go for the update panel but for all the Ajax controls.

So that’s it for now, hope to see you soon, untill then happy SharePointing.

5 thoughts on “Error: The type or namespace name ‘xxx’ could not be found

  1. Thanks for this. I was having this issue and it took me a while to guess the correct reference since there is not a System.Web.UI reference that I can add even though that namespace is the one in question.

  2. Thank you sharepointnoob for that blog. That was what I was looking for – the only problem is, when I add the line: “using System.Web.Extensions;”
    I get: “The namespace System.Web does not contain the namespace Extensions.”
    So what to do now?

    • You need to add a reference to System.Web.Extensions in order to use it in your project (under references in you project explorer).

Leave a Reply

Your email address will not be published. Required fields are marked *