Load .ascx page from database into LoadControl as a string
Posted: Thu Sep 18, 2008 11:24 am
Hi!
I want to store a .ascx file into the database (under productdescription) and then load it into another .ascx file using a placeholder and the LoadControl.
My problem is that I dont know how to get LoadControl to accept a string instead of a file.
If I use "ProductDescription.ascx" i can fetch the data from the correct file using "<asp:Literal ID="phCaption" runat="server" Text="Description" EnableViewState="false"></asp:Literal>", but that will not work for me cause I need the text from the database to be rendered together with the orginal .ascx page and not just inserted as regular text.
Any ideeas?
Best regards, Thomas
I want to store a .ascx file into the database (under productdescription) and then load it into another .ascx file using a placeholder and the LoadControl.
My problem is that I dont know how to get LoadControl to accept a string instead of a file.
If I use "ProductDescription.ascx" i can fetch the data from the correct file using "<asp:Literal ID="phCaption" runat="server" Text="Description" EnableViewState="false"></asp:Literal>", but that will not work for me cause I need the text from the database to be rendered together with the orginal .ascx page and not just inserted as regular text.
Any ideeas?
Best regards, Thomas