SHARE
TWEET

Untitled

a guest Feb 2nd, 2013 24 Never
  1. Master Page
  2.      Has few User Controls
  3.      Content Pages
  4.          Inherit from Base Class
  5.      User Controls within Content Pages
  6.        
  7. Page.master.findControl("label").Text = myClass.Setting1
  8.        
  9. public class SettingsData
  10. {
  11.   public string Setting1;
  12.   public string Setting2;
  13. }
  14.  
  15. public static class DataHolder
  16. {
  17.   public static SettingsData Settings = new SettingsData();
  18.   static DataHolder()
  19.   {
  20.     // open connection to db and query for values
  21.     Settings.Setting1 = <value from db>;
  22.     Settings.Setting2 = <value from db>;
  23.   }
  24. }
  25.        
  26. Label1.Text = DataHolder.Settings.Setting1;
RAW Paste Data
Top