Is there a way in .NET 2.0 to use a class as a class factory for user controls? In other words, 1 super that sits there and when I want a user control, it creates it and returns it to me. It seems it needs the ASP namespace which I can't seem to get it to reference.
I have a masterpage with a placeholder. Depending upon the user's authentication, I want to dynamically load the user control. For example, it might be a search control if they are authenticated, it might be an ad if they're not logged in. I can dynamically load them. But my plan was to use a single class to control this. Right now I have to load them right on the masterpage code behind. There is no code to show in the class because it won't let me reference the user controls, so I don't get far.