Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. public partial class Page1 :System.Web.UI.Page
  2. {
  3. public static LGDP.LDGPSession var1 = null;
  4.  
  5. private void Login(this, EventArgs e)
  6. {
  7. var1 = new LGDPSession(this, data, data);
  8. }
  9.  
  10. public bool IsLoggedIn()
  11. {
  12. bool login = false;
  13.  
  14. if (var1 != null)
  15. {
  16. login = true;
  17. }
  18.  
  19. return var1;
  20. }
  21. }
  22.  
  23. public partial class Page2 :System.Web.UI.Page
  24. {
  25. Page1.(nothing shows up here)
  26. }
  27.  
  28. private static bool _login = false;
  29.  
  30. public static void SetLoggedIn(object lgdps)
  31. {
  32. if (lgdps == null)
  33. {
  34. _login = false;
  35. }
  36.  
  37. if (lgdps != null)
  38. {
  39. _login = true;
  40. }
  41. }
  42.  
  43. public static bool IsLogin
  44. {
  45. get { return _login; }
  46. }
  47.  
  48. public class BasePage : Page
  49. {
  50. public bool IsLoggedIn()
  51. {
  52. bool login = false;
  53.  
  54. if (var1 != null)
  55. {
  56. login = true;
  57. }
  58. }
  59.  
  60. }
  61.  
  62. public partial class Page1 : BasePage
  63. {
  64. }
  65.  
  66. public partial class Page2 : BasePage
  67. {
  68. protected void Page_Load(object sender, EventArgs e)
  69. {
  70. if(IsLoggedIn())
  71. {
  72. }
  73. }
  74. }
  75.  
  76. public bool IsLoggedIn()
  77. {
  78. bool login = false;
  79.  
  80. if (var1 != null)
  81. {
  82. login = true;
  83. }
  84.  
  85. return login;
  86. }
  87.  
  88. public bool IsLoggedIn()
  89. {
  90. return var1 != null;
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement