Guest User

Untitled

a guest
Jan 22nd, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. //Login.aspx
  2. private Rti.Admin.Login lg = new Rti.Admin.Login();
  3. protected void Page_Load(object sender, EventArgs e)
  4. {
  5. IsLogged();
  6. }
  7.  
  8. protected void btnLogin_Click(object sender, EventArgs e)
  9. {
  10. lg.LoginCheck(tboxId.Text, tboxPwd.Text);
  11. IsLogged();
  12. }
  13. private void IsLogged() {
  14. if (lg.IsLogged())
  15. {
  16. if (Session["User"] == null)
  17. {
  18. Session["User"] = lg.Uid;
  19. }
  20. Response.Redirect("manager.aspx");
  21. }
  22. }
  23. //Manage.aspx
  24.  
  25. private Rti.Admin.Login lg = new Rti.Admin.Login();
  26. private SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["Act2008"].ConnectionString);
  27. private SqlCommand cmd = new SqlCommand();
  28. protected void Page_Load(object sender, EventArgs e)
  29. {
  30. IsNotLogged();
  31.  
  32. }
  33. private void IsNotLogged()
  34. {
  35. if (!lg.IsLogged())
  36. {
  37. Response.Redirect("index.aspx");
  38. }
  39. }
Add Comment
Please, Sign In to add comment