0

If e.g. I keep control markup in DB instead of ascx file. How can I load control from string constant?

(of course if I don't want to save copy to disk)

creo
  • 49
  • 6
  • If what you're attempting is to dynamically load a specific user control, why not store just the name of the user controls in the DB (e.g "MyControl1.ascx", "MyControl2.ascx"), then dynamically load the control in the code-behind using Page.LoadControl ? – RPM1984 Jun 02 '10 at 01:12

1 Answers1

0

Er... you can't really. Unless your control is a Server-Side control it's pre-compiled when the ASP.NET Website spins up. Also stored controls in a db wont be able to have sub-controls or markup-data-binding or data sets.

You should really only store the relevant data in the DB and generate markup in the page (like a view).

Aren
  • 54,668
  • 9
  • 68
  • 101