Lost Session when AddModelError
Posted
by Ph.E
on Stack Overflow
See other posts from Stack Overflow
or by Ph.E
Published on 2010-04-06T12:07:55Z
Indexed on
2010/04/06
12:13 UTC
Read the original article
Hit count: 369
ASP.NET
|asp.net-mvc
Friends,
I do not know why, but every time I add a ModelErrror my session is lost. Someone tell me how I can work around / fix it?
Session[CtSessionName + SessionId] = _ListaAcaoMenuInfo;
AcaoMenuInfoExt _SelecionadoAcaoMenuExt = _ListaAcaoMenuInfo.Where(p => p.Id_acao == id).FirstOrDefault();
if (_SelecionadoAcaoMenuExt.Is_AcaoInicial)
{
ModelState.AddModelError(String.Empty, "Error! Try Again, and Again, And Again!");
}
© Stack Overflow or respective owner