Redirect action to action in other area with model as parmenter
asp.net-mvc, asp.net-mvc-3, c#
Solution
There isn't an overload for `RedirectToAction` that takes 4 parameters.
Try this:
return RedirectToAction(
"ChangePassword",
"Account",
new { area = "", model = mode });
Problem
I am on Admin area now want to send the values to Account Controller which is in default area how i can send ``` ChangePasswordModel mode = new ChangePasswordModel(); mode.ConfirmPassword = password; mode.NewPassword = password; mode.OldPassword = user.Password; return RedirectToAction("ChangePassword", "Account",new { area = '/' } , new {model = mode}); ``` this is my other action in Account Controller where i want to redirect my code ``` [Authorize] [HttpPost] public ActionResult ChangePassword(ChangePasswordModel model) { if (ModelState.IsValid) { // ChangePassword will throw an exception rather // than return false in certain failure scenarios. bool changePasswordSucceeded; try { MembershipUser currentUser = Membership.GetUser(User.Identity.Name, true /* userIsOnline */); changePasswordSucceeded = currentUser.ChangePassword(model.OldPassword, model.NewPassword); } catch (Exception) { changePasswordSucceeded = false; } if (changePasswordSucceeded) { return RedirectToAction("ChangePasswordSuccess"); } else { ModelState.AddModelError("", "The current password is incorrect or the new password is invalid."); } } // If we got this far, something failed, redisplay form return View(model); } ```