3

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?

3

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:

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

Good luck

  • 1
    replace start tag with <%@ Register Tagprefix="asp" .... and add it directly in your ascx – Iman Abidi Sep 23 '14 at 9:28
2

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

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

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=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>

Add:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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