Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

Localization/culture is lost upon AJAX request

$
0
0

Hi,

Because of filter functionality we have created a form that is posted asynchronously to retrieve all items that match the given criteria. This is done using regular MVC controllers, but this raises a problem.

Upon entering the controller, the current culture and the PreferredCulture of ContentLanguage is reset to the master language. Multiple languages are available, so we've tried to force it to a different language. However, when one ContentArea is rendered (with Html.PropertyFor) the PreferredCulture of ContentLanguage was reset to the master language once more. The first block of the page has been rendered in the second language and the rest of the page in the master language.

I'd like to add that this only happens when the language is changed for this first time, or when the page is reloaded without cache (ctrl + f5). 

Is there anyone who could explain why this is happening?

Kind regards,

Bram van der Zee


Viewing all articles
Browse latest Browse all 9076

Trending Articles