Hi,
This is the english (which is working)
<form action="/get-in-touch/" method="post" novalidate="novalidate">
This is the welsh that is not working
<form action="/cy-GB/cysylltu-a-ni/" method="post" novalidate="novalidate">
This is all create created with this html in the page.
@using (Html.BeginForm("Index", "GetInTouchForm", new { language = ContentLanguage.PreferredCulture.Name }, FormMethod.Post))
{
}
This is the Controller mark up
public class GetInTouchFormController : PageControllerBase<GetInTouchForm> { [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 }; }
That is Welsh for get-in-touch - it is the translated page name. Is that the reason it is not posting back?
So, just to be sure...
Hi,
Yes that is correct.
If you would like to have a look at the UAT site it is here: https://uat.goconstruct.org/cy-gb/cysylltu-a-ni/
I hope it helps a bit - you can see the english version by either clicking English at the top of the page or browse here https://uat.goconstruct.org/get-in-touch/
Thanks for all your help
I think I can see the issue there. The action on your form includes /cy-GB/ but it looks like you're redirecting URLs to their lower case equivalent so when you post to /cy-GB/cysylltu-a-ni/, it 301 redirects to /cy-gb/cysylltu-a-ni/.
It looks like that's an issue throughout the site so, for each page you request, the end user's browser will end up making 2 requests (the initial mixed case request and the redirected lower case request). You can fix that pretty easily in Episerver admin -> Config -> Manage Website Languages then clicking on your language and changing the web address prefix to cy-gb rather than blank or cy-GB.
You know, to be honest - I've been able to submit the form back, but got 301 redirect as response. IMHO (looking at network tab) seems like this is related to lowercase redirects, because form is being posted to "/cy/GB/...", but got back redirect to "/cy-gb/...". You should check your redirection or canonical url rules.
Also, I was not aware that welsh is so different language compared to rest. Thanks for giving opportunity to realize it.
You two guys are amazing - not even Episerver help desk could find this fix. That is perfect thank you both ever so much :)
Hi,
I am using Episerver 7.5 and I have a site that uses a Translated site too - using the Sites tab.
One of the Templates I have a button that posts back to a Controller (Index) to verify a user.
In the Default english page this works fine but when I swap language to Welsh and click the button it doesnt post back to the controller.
Is there a reason for this?
Jon