I am using TempData to pass the guid between two action methods within the same controller, but I am getting null in the second method where I am calling it.I am not able to figure out why I am getting a null value.
Here is what I could do so far:
[HttpPost]
public ActionResult ForgotPassword(ForgotPasswordModel model)
{
var uniqueIdForUser = db.Database.SqlQuery<RequestResetPasswordModel>("spResetPassword @param1", new SqlParameter("param1", user.ADMIN_USERNAME)).OrderBy(m => m.UserId).FirstOrDefault();
TempData["uniqueIdForUser"] = uniqueIdForUser.Id;
}
[HttpPost]
public ActionResult ResetPassword(ResetPasswordModel model)
{
Guid uniqueid = (Guid)TempData["uniqueIdForUser"];
return View();
}