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: 364

Filed under:
|

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

Related posts about ASP.NET

Related posts about asp.net-mvc