I've managed to load a User Control dynamically using (where hldContent is a PlaceHolder control):
However I want to be able to add the register statement needed at runtime not in the source code.Code:IntroText_ascx intro = (IntroText_ascx) LoadControl("IntroText.ascx"); intro.ID = "intro"; intro.ContentText = "Example"; hldContent.Controls.Add(intro);
Anyone got any idea if this is possible?Code:<%@ Register TagPrefix="HROC" TagName="IntroText" Src="IntroText.ascx" %>
Basically I want to load user controls from a database as and when they are needed and not need to have 100's of register statements on every page.
DJ





Reply With Quote