Best place to set CurrentCulture for multilingual ASP.NET MVC web applications

后端 未结 5 1806
死守一世寂寞
死守一世寂寞 2020-11-28 07:22

For multilingual ASP.NET MVC 3 web application, I am determining the Thread.CurrentThread.CurrentCulture and Thread.CurrentThread.CurrentUICulture

5条回答
  •  天涯浪人
    2020-11-28 08:09

    An alternative place to put this would be to put that code in the OnActionExecuting method of a custom ActionFilter, which can be registered in the GlobalFilters collection:

    http://weblogs.asp.net/gunnarpeipman/archive/2010/08/15/asp-net-mvc-3-global-action-filters.aspx

提交回复
热议问题