Running Sitecore 7.1 update 2, I'm creating a login form and here's the setup:
"LoginController" has methods "Index" and "Login" and one view "Index"
A controller rendering is created, the controller field has the "namespace and dll" and the action field has "Index". I'm using MVC Areas, this is why I had to specify the namespace and dll.
A content item has the layout configured with the "Index" controller rendering
The "Index" view has the following code (at first I used the normal MVC begin form but that did not work):
@using (Html.BeginRouteForm(MvcSettings.SitecoreRouteName, FormMethod.Post))
{
@Html.Sitecore().FormHandler("Login", "Login")
//form fields...
}
When I submit the form with incorrect credentials I want to show the form (view) again and display the errors, I get the view but stripped out from the layout.
I did not know about the Sitecore FormHandler method until I googled to solve this problem, did not see it the documentation either. Any resources on Sitecore MVC? Content related to Sitecore 7.1 please as most of the examples I found were Sitecore 6 and outdated.
Thanks