ASP.NET - Web Application, UserControls and NullReferenceExceptions
I have a web app that works great if I enable my custom 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 the need to integrate with Umbraco. When I replace the register declaration:
<%@ Register TagPrefix="mine" Namespace="MyAssembly.UserControls" Assembly="MyAssembly"%>
I am getting a null reference exception in the UserControl Page_Load event (which references an ASP.NET control that is being used by the UserControl itself.
I find this rather odd, but I found very little information on how to fix it.
+2
a source to share
1 answer
Have you tried putting links in your Web.config file?
Like this:
<compilation debug="true">
<assemblies>
[...]
<add assembly="DevExpress.Web.ASPxEditors.v8.3" />
</assemblies>
</compilation>
UPDATE:
Then maybe you can also register your controls in the Web.config like:
<pages theme="Default">
<controls>
[...]
<add assembly="DevExpress.Web.ASPxEditors.v8.3" namespace="DevExpress.Web.ASPxGridView" tagPrefix="dxe" />
</controls>
</pages>
+1
a source to share