Advertisement
Guest User

Untitled

a guest
Sep 29th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. if (Sessions.Current.authenticated != null)
  2. {
  3. if (Sessions.Current.authenticated)
  4. {
  5. Response.Redirect("Admin/Default2.aspx");
  6. }
  7. }
  8. }
  9.  
  10. protected void login(object sender, EventArgs e)
  11. {
  12. string username = txtUsername.Text.ToString();
  13. string password = txtPassword.Text.ToString();
  14.  
  15. DataTable dtUser = DBConnector.getTable("SELECT * FROM User WHERE Username = '" + username + "' AND Password = '" + password, false);
  16. if (dtUser.Rows.Count > 0)
  17. {
  18.  
  19. DataRow dr = dtUser.Rows[0];
  20. Sessions.Current.authenticated = true;
  21. Sessions.Current.lastfirst = dr["Name"].ToString();
  22. Sessions.Current.Usertype = dr["userType"].ToString();
  23.  
  24.  
  25. Response.Redirect("Admin/Default2.aspx");
  26. Response.Redirect("web/Default.aspx");
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement