title: How to set styles from database runtime?
body: <p>I'm having hard time finding a nice and clear solution on how to create a web page that loads it's style attributes from a database f.ex. button back- and forecolor, font size etc.to a Session object and from there would set them on each page to needed controls. </p>
  
  <p>I have a loader in the Global.asax -> Session_Start which loads the values from db to session object called "settings". Next I tried to use Themes and set those attributes on a skin file f.ex. </p>
  
  <pre><code>&lt;asp:Button BackColor="&lt;%=((Settings)Session["settings"]).BtnBackColor%&gt;" 
  </code></pre>
  
  <p>to make it simple to change all the buttons at one place. But on ASP.NET one can't set attributes like that on server controls. </p>
  
  <p>So there's of course the possibility that on each and every web page I set those styles in the Page_Load method on each web control I have but I don't consider that very robust a, efficient or neat option. </p>
  
  <p>So if someone would have any idea on this, how it should be done so that the maintenance and the robustness of the code preserves as good as possible I really would appreciate your help.</p>