Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 25th, 2012  |  syntax: None  |  size: 0.76 KB  |  hits: 11  |  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. Use a Profile in an ASP.NET Web Application [closed]
  2. public class ProfileCommon
  3. {
  4.     public Teachers Teachers
  5.     {
  6.         get
  7.         {
  8.             return (Teachers)
  9.                 HttpContext.Current.Profile.GetPropertyValue("Teachers");
  10.         }
  11.         set
  12.         {
  13.             HttpContext.Current.Profile.SetPropertyValue("Teachers",value);
  14.         }
  15.     }
  16. }
  17.        
  18. ProfileCommon Profile = new ProfileCommon();
  19. protected void Button1_Click(object sender, EventArgs e)
  20. {
  21.     Teachers teachers = new Teachers();
  22.     teachers.Add(new Teacher("scott"));
  23.     teachers.Add(new Teacher("bob"));
  24.     teachers.Add(new Teacher("paul"));
  25.  
  26.     Profile.Teachers = teachers;    
  27. }
  28.        
  29. public static class Profile
  30. {
  31.     public static Teachers Teachers
  32.     {
  33.         //......
  34.     }
  35. }