Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hi,
I have a bespoke form in 7.5 and it works well in english but it never posts when in a different langauge for example:
testsite.com/myform works in English - notice there is no language path in the URL as en is the default language set in the CMS
but testsite.com/cy-GB/myform does not hit the Controller - it just refreshes the page.
This is my HTML:
and this is my Controller:
public class GetInTouchFormController : PageControllerBase
{
[HttpGet]
public ActionResult Index(GetInTouchForm currentPage)
{
var model = new GetInTouchFormModel(currentPage);
return View(model);
}
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Index(GetInTouchForm currentPage, GetInTouch CustomForm)
{
var model = new GetInTouchFormModel(currentPage) { CustomForm = CustomForm };
}
I have put this in my Global but it didnt resolve the issue:
protected override void RegisterRoutes(RouteCollection routes) { base.RegisterRoutes(routes); routes.MapRoute("submit", "{language}/{controller}/{action}", new { action = "Index" }); routes.MapRoute("default", "{controller}/{action}", new { action = "index" }); }
Any ideas?
Thanks for your help,
Jon
[Pasting files is not allowed]