0

I'm trying to create a form in episerver, it's just an ASP.NET MVC site. The piece of code I'm using is this

@using (Html.BeginForm("Index", "Search", new { language = ContentLanguage.PreferredCulture.Name }, FormMethod.Get))
{
   ...
}

When the page is rendered, I get:

<form action="/site-search/Index?language=en" method="get">...</form>

however, I need the "en" language component to be put at the start of the URL like so:

"/en/site-search/Index"

The reason it is needed there is because the site uses multiple languages and this is how it checks to see which version of the page to serve.

Anyone have any ideas on how to move the "/en/" component to the front of the url using the Html.BeginForm() method?

4

0 回答 0