ASP.net - First build fails with 'Unknown server tag'
I have multiple custom controls used on a ASPX (and C#) page registered from within the page rather than in Web.Config.
On the first bu开发者_Go百科ild (or rebuild), build fails with error messages for wherever I've used the custom controls. Subsequent builds are successful.
The error message:
Unknown server tag 'prefix:ExampleControl'.
What might cause this, and how can I fix it?
Register syntax:
<%@ Register Src="ControlsFolder/ExampleControl.ascx" TagName="ExampleControl" TagPrefix="prefix" %>
<!-- etc -->
Usage syntax:
<prefix:ExampleControl runat="server" ID="ExampleControl1" />
<!-- etc -->
Is this in VB.Net? VB has a "helpful" way of handling namespaces that can be really confusing. Have you tried deleting and recreating the control?
精彩评论