Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 2nd, 2013  |  syntax: None  |  size: 0.58 KB  |  views: 20  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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;