This is one of those questions where I could just wade in and try to figure it out, but I'd rather ask for some tips first so I don't head down a blind alley :) Here's what I am trying to accomplish:
I am writing a module which will have a large number of .ascx User Controls on top of a common business logic and data layer. The intention is that the "core" of the module (the business logic and data layer) goes through a managed release cycle, whereas the User Controls can be added/updated as needed, independent of the release cycle. There is nothing hard coded in the core or .dnn manifest that references any particular User Control - at runtime they are loaded dynamically based on data in the database. Basically these 2 aspects of the module will be in the hands of 2 different teams of people - .NET developer team manages core, web designers manage User Controls, and the teams need to be able to work independently.
Each User Control's code behind file has to inherit from a "user control base class" that is part of the core. The base class contains a few methods that the user control can use to help load, validate and save its data.
I am dynamically injecting the user controls into PlaceHolders in my module's default ASCX control using code like the following:
Dim
ic
As
InputControlBase
Dim
InputControlPath as
String
= DotNetNuke.Common.ResolveUrl(InputControlsPath & InputControlASCX)
ic =
CType
(
Me
.LoadControl(InputControlPath), InputControlBase)
phInputControlPlaceHolder.Controls.Add(ic)
The core of the module would be a WAP project in VS. The user controls would be a WSP project. The WSP project would have a reference to the core's assembly so that the user controls could inherit from the base class maintained in the WAP project.
So now a few questions:
Is the above in theory possible?
Could the code in the 2 projects share a common namespace, or mayeb the user control code live in a "sub namespace" of the core's?
Could the user controls live under /DesktopModules/ModuleName/Controls, or does all uncompiled code have to live in /App_Code?