Guest User

Untitled

a guest
Mar 14th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using System.Configuration;
  8.  
  9. namespace LoginVjezba
  10. {
  11. public partial class _Default : System.Web.UI.Page
  12. {
  13. protected void Page_Load(object sender, EventArgs e)
  14. {
  15. if (User.Identity.IsAuthenticated == true)
  16. {
  17. Response.Redirect("~/home.aspx");
  18. }
  19. }
  20.  
  21. protected void AutentificateLoginKorisnik(object sender, AuthenticateEventArgs e)
  22. {
  23. if (this.LoginKorisnik.UserName == ConfigurationManager.AppSettings["username"] &&
  24. this.LoginKorisnik.Password == ConfigurationManager.AppSettings["password"])
  25. {
  26. e.Authenticated = true;
  27. }
  28. else
  29. {
  30. e.Authenticated = false;
  31. }
  32. }
  33. }
  34. }
Add Comment
Please, Sign In to add comment