Try our conversational search powered by Generative AI!

Razor Html.BeginForm

Vote:
 

How is the way to specify action/controller for a Razor Html.BeginForm???

It seems to me that it's Html.BeginForm(action, controller...), but in name of controller, we've to use the friendly url, not the controller name (error 404 not found).

But what happens with language????, is it necessary to to write the code like this???:  Html.BeginForm(action, language/url...)... for example, to access the index action of productpagecontroller,

we have to write something like Html.BeginForm("", actual-language/products...), is that right??? Can anybody explain me how to work with Html.BeginForm for multisite multilanguage websites????

Thank you in advance.

#140954
Nov 04, 2015 23:16
Vote:
 

Hi,

I think you can add language as route value, @Html.BeginForm("Index", "ProductPage", new { language = ContentLanguage.PreferredCulture.Name } )

#140996
Nov 06, 2015 7:54
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.