MVC Model binders are run before the CurrentUICulture is set

Vote:
 

My guess is that EPiServer sets the CurrentUICulture(and CurrentCulture) somewhere in the IRouteHandler, IControllerFactory or the actioninvoker, based on which language version of the page is visisted. The problem is that i think it is set after Mvc Model binding occurs.

This is a problem when you try to submit a decimal value to an action and use other languages than english. 

Can anyone else confirm this problem?

#73733
Aug 07, 2013 12:08
Vote:
 

Did find a diagram of the asp.net mvc pipeline (mvc version is not specified tho). It looks like model binding is happening in the ActionInvoker before any filters are executed. Maybe the language is set in a ActionFilter (Ouch)?

I will investigate ...

#73734
Aug 07, 2013 12:15
Vote:
 

Hmmm did create another more simple viewmodel for testing purposes and here i cannot recreate the problem.

So i guess it has something to do with our code and not EPiServer ... ofcourse 

#73737
Aug 07, 2013 13:36
Vote:
 

Btw i discovered that this was an issue with the default mvc model binders when using GET method. It has nothing to do with EPiServer CMS.

As far as i can read, the solution is to create custom model binders for decimal/double if you need to use GET.

#73769
Aug 08, 2013 16:16
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.