loading usercontrol templates dynamically from database
-
Hi all I have created usercontrol templates and stored the template code in database. The templates are for instance postcards, visiting cards etc.. I want to load these usercontrol templates dynamically to my web page. I referred to http://aspalliance.com site where the author has mentioned about use of usercontrol templates... I want to know how I can load the the usercontrol using the template code from database on the web page... please help me... thanks in advance...
-
Hi all I have created usercontrol templates and stored the template code in database. The templates are for instance postcards, visiting cards etc.. I want to load these usercontrol templates dynamically to my web page. I referred to http://aspalliance.com site where the author has mentioned about use of usercontrol templates... I want to know how I can load the the usercontrol using the template code from database on the web page... please help me... thanks in advance...
Hi there. A UserControl, as a subclass of TemplateControl can use the LoadControl() method to load a usercontrol given a virtual file path. Unfortunately, there isn't an override that allows you to load a usercontrol given a string (which could be fed by your database source). However... in ASP.NET 2.0 we now have the VirtualPathProvider[^] class. It seems to me you may be able to build your own VirtualPathProvider to intercept requests for ".ascx" files and instead get that data from the database. That sounds like a pretty good concept for a CP article...
-
Hi all I have created usercontrol templates and stored the template code in database. The templates are for instance postcards, visiting cards etc.. I want to load these usercontrol templates dynamically to my web page. I referred to http://aspalliance.com site where the author has mentioned about use of usercontrol templates... I want to know how I can load the the usercontrol using the template code from database on the web page... please help me... thanks in advance...