public ActionResult Register(RegisterModel model, string returnUrl)
 {
     if (base.ModelState.IsValid)
     {
         try
         {
             bool requireConfirmationToken = true;
             string confirmationToken = WebSecurity.CreateUserAndAccount(model.UserName, model.Password, null, requireConfirmationToken);
             this.SendRegistrationConfirmMail(ConfirmMailOperation.confirm, model.UserName, confirmationToken);
             return base.RedirectToAction("registersuccess", new { returnUrl = returnUrl });
         }
         catch (MembershipCreateUserException exception)
         {
             base.ModelState.AddModelError("", ErrorCodeToString(exception.StatusCode));
         }
     }
     ((dynamic) base.ViewBag).ReturnUrl = returnUrl;
     return base.View(model);
 }
 public ActionResult Register(string returnUrl)
 {
     RegisterModel model = new RegisterModel();
     ((dynamic) base.ViewBag).ReturnUrl = returnUrl;
     return base.View(model);
 }