SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm developing a visual web part in Visual Studio 2010 for sharepoint and i have a listview control embedded.

I keep getting this error message in runtime even though I made sure it's namespaces are included and everything in the right place.

any ideas?

share|improve this question
up vote 3 down vote accepted

I read some threads talking about a bug in .net 3.5 and that we need to reinstall the SP1 to solve the problem, while I found this time-savy solution by simply adding a line to web.config:

inside the tag:

    <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

Good luck

share|improve this answer
replace start tag with <%@ Register Tagprefix="asp" .... and add it directly in your ascx – imanabidi Sep 23 '14 at 9:28

Made sure the build setting is 3.5 and not 3.5 Client Profile?

share|improve this answer
yeah, it's installed with Sharepoint 2010. so It's not the client profile – Bassel Alkhateeb Nov 1 '10 at 8:37

The Visual Web Part template references the Extensions DLL that comes in .NET 3.5, but does not register all of the namespaces. This means the namespace System.Web.UI.WebControls needed for ListView is missing.

Below this line:

<%@ Register Tagprefix="asp" Namespace="System.Web.UI"
    Assembly="System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>


<%@ Register Tagprefix="asp" Namespace="System.Web.UI.WebControls"
    Assembly="System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.