Hallo Richard, sadly it won't build as well, giving the same error.
It's like if the ascx cannot access the code behind for some reason. I also deleted and recreated the .designer file but with no luck.
I'm working with dal2 vb Christoc template and I get this kind of behaviour right off the bat after install and initialization. Infact the Localization function provided by Christoc template in ascx markup, which should be inherited from PortalModuleBase won't work.
There are several workaround I could exploit working directly from code behind but this seems to be symptomatic of a more "serious" misconfiguration or similar issue. Also in some situations, it could be really useful to be able to access code behind properties/function from ascx (like for example to add some dynamica parts in javascript code in ascx without having to render all the JS from code behind).
Another very odd issue I'm experiencing is in the Edit.ascx page, provided with Christoc template, even if I remove the reference:
<%@ Register TagPrefix="dnn" TagName="label" Src="~/controls/LabelControl.ascx" %>
And remove the 3 labels:
.....
In the first line, that declares the control I have the error: Namespace or type specified in the Imports 'DotNetNuke.UI' doesn't contain any public member or cannot be found.....
But I don't have the import anywhere.... not even at project level.
UPDATE: I created a new solution from scratch with a single user control class added from VS template. I experience the same behaviour, I cannot access code behind properties/functions from user control ascx. So I changed the class to aspx and inherited from Page, and with my surprise I had the same problem. I'm new to Web Applications, I usually work with Website Projects, and I wonder if this is a common behaviour in WAP (I'm sure that this should work with Website Projects)