I would like to store the ascx control code into a database. Then rather then load the control from a filepath location, I would like to retrieve it from the database and load it into the UserControl. The UserControl.LoadControl only has two overload options. Without saving the control from a database to a temporary file and then load from the temporary file, is it possible do this direct from the database?
Can you use ParseControl
instead? Link to MSDN.
The method accepts a string that is then compiled on the fly as a Control
object.
You could load your control markup from the database and then hand it off to ParseControl
to get an instance of your control back.
Hope this helps!