Blocks on loginpage gives strange error when not having correct login information

I have added 2 containers on my LoginPage so the customer can use Blocks.
The problem that appears are: When the user tries to login and are entering wrong username/password the @Html.Block inside the file _BlockContainer.cshtml throws an exception that the block cannot find the ActionMethod “index” for the current block (dosent matter what kind of block i’m using). This happens after the page is reloaded and we are returning back the viewmodel again after setting the modelstate “LoginFailed”

Is there a restriction that you cannot use Blocks on the loginpage or have I missed something?

Litium version: 7.3

The error is because there’s no Index action method on the block that’s allowed to be called on a POST request, since the action is decorated with [HttpGet].

Ok that makes sence, humm. Thanks man!

1 Like

You can try using [AcceptVerbs(HttpVerbs.Get | HttpVerbs.Post)] instead to accept both.

I’m right on to try just that.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.