locked
Element 'UserControl' is not a known element error, after converting to WAP RRS feed

  • Question

  • User1392854443 posted

    I have read all kinds of blogs and posts on your site and I may have missed a solution and if I have I apologize.  But here is my problem.

    I have been trying to upgrade my existing VS 2005 Web Site to a Web Application (that comes with SP1).  I followed Scott's migration tutorial [ http://webproject.scottgu.com/CSharp/Migration2/Migration2.aspx ] but I have many problems regarding UserControls.  If you can help me or point me in the right direction, that would be great.  

    All my user controls report the same error.  "Element 'UserControl' is not a known element. This can occur if there is a compilation error in the Web site."

    This may or may not be related to all server controls and user controls that are inside an AJAX UpdatePanel report a compile error:  "The name 'ControlName' does not exist in the current context"

    The above errors are the ONLY errors I get during compile.  If you can help in any way, that would be GREAT! 

    Thank you. 

    Sample .aspx code, with ucObjContent errors... 

    <%@ Control Language="C#" AutoEventWireup="true" Inherits="BINavigator.Dashboard_UserControls_ucLayout" Codebehind="ucLayout.ascx.cs" %>
    <%@ Register TagPrefix="uc1" TagName="ucObjContent" src="ucObjContent.ascx" %>
    <%= GetFrameTablePart("a") %>
    <uc1:ucObjContent id="ucObjContent1" runat="server" />
    <%= GetFrameTablePart("b") %>
    <uc1:ucObjContent id="ucObjContent2" runat="server" />

    Tuesday, July 24, 2007 11:50 AM

All replies

  • User723935806 posted

    I know this is quite an old post but just replying so that people who visit might benefit.(If my solution below fixes the problem).


    Right click on the project and select clean and then build the project again.

    Cleaning should clear all the dll's in your bin directory and build the project from scratch.


    Tuesday, August 3, 2010 10:40 AM
  • User1634523241 posted

    Also, make sure that you didn't forget or obliterate 'public' on the custom control's constructor.  If you hide the constructor this is what you get.

    Wednesday, March 6, 2013 12:51 AM