thuannguy
asked on
ASP.NET custom control: Element is not a known element. This can occur if there is a compilation error in the Web site
Hi Experts,
I'm developing a custom control called MyDateTimeControl. When I register the control to an aspx file in VS2005 like this:
<%@ Register TagPrefix="UC" TagName="MyDateTimeControl " Src="~/UserControls/MyDate TimeContro l.ascx" %>
The tag "~/UserControls/MyDateTime Control.as cx" is underlined in red and the IDE says that "File '~/UserControls/MyDateTime Control.as cx' was not found".
In addition, when I declare an instance of the control:
<UC:MyDateTimeControl runat="server" id="dtcFrom" ></UC:MyDateTimeControl >
I get this error: "Element MyDateTimeControl is not a known element. This can occur if there is a compilation error in the Web site"
However, I can compile the project and it runs very well. The problem is I cannot use intellisence and the designer.cs file is not regenerated automatically whenever a new control is added anymore.
Could any one show me how to eliminate this annoying problem?
Thank you in advance.
I'm developing a custom control called MyDateTimeControl. When I register the control to an aspx file in VS2005 like this:
<%@ Register TagPrefix="UC" TagName="MyDateTimeControl
The tag "~/UserControls/MyDateTime
In addition, when I declare an instance of the control:
<UC:MyDateTimeControl runat="server" id="dtcFrom" ></UC:MyDateTimeControl >
I get this error: "Element MyDateTimeControl is not a known element. This can occur if there is a compilation error in the Web site"
However, I can compile the project and it runs very well. The problem is I cannot use intellisence and the designer.cs file is not regenerated automatically whenever a new control is added anymore.
Could any one show me how to eliminate this annoying problem?
Thank you in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.