Advertisement
Guest User

Untitled

a guest
Aug 14th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. @{
  2. if(IsPost){
  3. WebSecurity.Logout();
  4.  
  5. string username = Request.Form["username"];
  6. string password = Request.Form["password"];
  7. string confirmPassword = Request.Form["confirmPassword"];
  8.  
  9. if(password != confirmPassword){
  10. Json.Write("Wachtwoord komt niet overeen.", Response.Output);
  11. }
  12. else {
  13. if(WebSecurity.UserExists(username)){
  14. Json.Write(String.Format("Gebruiker '{0}' bestaat al.", username), Response.Output);
  15. }
  16. else{
  17. WebSecurity.CreateUserAndAccount(username,password,null,false);
  18. WebSecurity.Login(username, password, true);
  19. Json.Write("success", Response.Output);
  20. }
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement