I'm sorry if i'm confusing you. I didn't mean that you have to use Ventrian module. :)
What I mean is you can learn from how ventrian module manage user control dynamically in their module.
First, you have to create one .ascx file (ie. sample.ascx)
Then put one placeholder onto it and name it 'plhControl'.
Go to your code behind, and change your UserControl class into PortalModuleBase class as usuall.
Declare private string variabel in page level, name it mControlToLoad.
Create two method, feel free to name it (as a sample, I wil name it ReadQueryString and LoadControlType).
private void ReadQueryString() {
if (Request.QueryString["ControlType"] != null) {
switch (Request.QueryString["ControlType"].ToString().ToLower()) {
case "view":
mControlToLoad = "yourfrontpage.ascx";
break;
case "edit":
mControlToLoad = "edit.ascx";
break;
case "report":
mControlToLoad = "report.ascx";
break;
case "default":
mControlToLoad = "yourfrontpage.ascx";
break;
}
} else {
mControlToLoad = "yourfrontpage.ascx";
}
}
private void LoadControlType() {
PortalModuleBase pmb = (PortalModuleBase)this.LoadControl(mControlToLoad);
if (pmb != null) {
pmb.ModuleConfiguration = this.ModuleConfiguration;
pmb.ID = System.IO.Path.GetFileNameWithoutExtension(mControlToLoad);
plhControls.Controls.Add(pmb);
}
}
Register your two method in Page_Init method.
protected void Page_Init(object sender, EventArgs e) {
ReadQueryString();
LoadControlType();
}
In your module definition, just register sample.ascx once. And now you can add as many controls as you like.
HTH.