views:

203

answers:

1

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 build (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 -->
+1  A: 

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?

Spencer Ruport
It's in C#.Net. By deleting and recreating the control, do you mean the tag, reference, or the ascx/cs files?
Sophia
The actual files. I haven't seen this sort of thing with C# but it's worth a shot I suppose.
Spencer Ruport
No luck with that unfortunately, thanks though :)
Sophia