Form not saving and not redirecting (v3.0.21 in Umbraco 7.1.8)
In a nutshell, I have installed Contour 3.0.21 into Umbraco 7.1.8 (locally for now) and my contact form is successfully rendered to the page, although the action attribute is empty (should this be the case?).
Anyway, when the form is submitted the data is not being saved and the page is not redirecting to my specified thank you page. I have a valid license but I would expect this to work anyway in a local environment. There is nothing in the logs which suggests that actually nothing is happening.
There are a couple of additional factors at play here too - I'm using Autofac to register my controllers, and I am using a modified version of the hybrid framework so I have a default controller etc.
The macro is rendered using:
@Umbraco.RenderMacro("umbracoContour.RazorRenderForm", new { FormGuid = "b83ddaeb-7910-41ae-a5f8-3c0a514bf1ef" })
I would expect the action to be rendered as whatever route Contour registers for the ContourForm() on the FormRenderController but then maybe Contour is not registering a route?
Can any one help please? Am I missing something really basic here?
Form not saving and not redirecting (v3.0.21 in Umbraco 7.1.8)
In a nutshell, I have installed Contour 3.0.21 into Umbraco 7.1.8 (locally for now) and my contact form is successfully rendered to the page, although the action attribute is empty (should this be the case?).
Anyway, when the form is submitted the data is not being saved and the page is not redirecting to my specified thank you page. I have a valid license but I would expect this to work anyway in a local environment. There is nothing in the logs which suggests that actually nothing is happening.
There are a couple of additional factors at play here too - I'm using Autofac to register my controllers, and I am using a modified version of the hybrid framework so I have a default controller etc.
The macro is rendered using:
@Umbraco.RenderMacro("umbracoContour.RazorRenderForm", new { FormGuid = "b83ddaeb-7910-41ae-a5f8-3c0a514bf1ef" })
and the form itself is the standard:
@using (Html.BeginForm("ContourForm", "FormRender", FormMethod.Post, new { enctype = "multipart/form-data" })) { ... }
I would expect the action to be rendered as whatever route Contour registers for the
ContourForm()
on theFormRenderController
but then maybe Contour is not registering a route?Can any one help please? Am I missing something really basic here?
Turns out I was missing the
@Html.AntiForgeryToken()
line in the form. One to remember.is working on a reply...