Exemplo n.º 1
0
        public ActionResult Register(string userName, string email, string pass, string pswRepeat)
        {
            WebUser user = new WebUser();

            user.Username = userName;
            user.Email    = email;
            user.Pass     = pass;

            if (!email.Contains("@") || !email.Contains("."))
            {
                ViewBag.Info = "E-Mail is not in the correct format";
                //Response.Cookies["lblInfo"].Value = "E-Mail is not in the correct format";
                //Response.Cookies["lblInfo"].Expires = DateTime.Now.AddMinutes(5);
                //return RedirectToAction("Registration", "Login");
            }

            //Provjera
            WebApiApplication.BackendPost <WebUser>(user, WebApiApplication.URL_REGISTRATION_PATH);

            return(RedirectToAction("Index", "Login"));
        }