Error validating home page after Login/Password

Asked

Viewed 37 times

1

I have an access validation (Login/Password) that if true, should return to the home page, but return me the following error:

Invalidoperationexception: Renderbody Invocation in '/Views/Shared/_Layout.cshtml' is invalid. Renderbody can only be called from a page layout.

Follow Controller that checks and should return to view:

if (cli.ValidarAcesso(cli.CliCodigo, cli.CliSenhaWeb, _config) > 0)
            {

                return View("_Layout", new Clientes());
            }

1 answer

1


This error is not from the Controller, it is from your View. Try to put @RenderBody() in the "center" of your view. If it doesn’t work, put your view code here.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.