I am creating an HttpModule that needs to know the value of Thread.CurrentThread.CurrentCulture as set in the MVC application. This value is currently set by BaseController, but when my HttpModule.PostRequestHandlerExecute () method fires, it goes back to what it was before Culture before rendering the page.
I duplicated this by creating a simple web application with these steps:
- Module.PreRequestHandlerExecute: set culture to A
- Page_Load: The current culture A. Set the culture to B
- Module.PostRequestHandlerExecute: The current thread culture is A. I expected it to be B, but it was changed between page rendering and PostRequestHandlerExecute
Any idea why .Net is changing this value or how can I get around it? The thread is the same, so something in .Net should explicitly return the culture.
source
share