I have a problem with validation messages not showing after a redirect, even when Im using MVCConrib's ModelStateToTempData. Am I overlooking something fundamental?
[ModelStateToTempData]
public class AccountController : BaseController
{
public ActionResult LogOn(string email, string password, string returnUrl)
{
if (!ValidateLogOn(email, password))
{
return RedirectToAction("Index", "AnotherController");
}
//other stuff
}
private bool ValidateLogOn(string email, string password)
{
if (!_userTask.ValidateUser(email, password))
{
ModelState.AddModelError("message", "The email or password provided is incorrect.");
}
return ModelState.IsValid;
}
}
View:
<li>
<label for="email">E-mail</label>
<%= Html.TextBox("email")%>
<%= Html.ValidationMessage("message") %>
</li>