Problems with @Register in VS2005
Posted on 2006-06-22
I had a VS2003 ASP.NET application, which I converted to a VS2005 Web Site Project. Now I am converting it to a VS2005 Web Application Project. Most of the things work but not the @Register directive.
I have a control class inheriting from System.Web.UI.WebControls.ImageButton. It's in a .CS file and does not have an .ASCX file. I try to register it like this in the page:
<%@ Register TagPrefix="cc1" Namespace="MyApp.MyButtons" %>
Then I use the control as:
<cc1:MyImageButton id="myButton" runat="server"></cc1:MyImageButton>
The designer underlines the tag and tells me: Element 'MyImageButton' is not a known element. This can occur if there is a compilation error in the Web site.
This worked just fine in VS2003 and also in VS2005 Web Site Project.