ASP.NET - Web Application, UserControls and NullReferenceExceptions
- by Echilon
I have a web application, which works fine if I include my user controls with
<%@ Register TagPrefix="mine" TagName="MyUC1" Src="~/UserControls/MyUc1.ascx" %>
<%@ Register TagPrefix="mine" TagName="MyUC2" Src="~/UserControls/MyUc2.ascx" %>
But I need to use the namespace due to needing to integrate with Umbraco. When I replace the register declaration with:
<%@ Register TagPrefix="mine" Namespace="MyAssembly.UserControls" Assembly="MyAssembly"%>
I get a null reference exception in the UserControl's Page_Load event (which references an ASP.NET control which is used by the UserControl itself.
I find this pretty bizarre, but I've found very little information on how to fix it.