global.asax Application_AcquireRequestState vs. Application_BeginRequest

前端 未结 2 2327
故里飘歌
故里飘歌 2021-02-20 04:44

what is the difference? I would like to implement Language dropdown selection in my app. So when a selected language is selected, a Thread culture would be set and page reloaded

2条回答
  •  爱一瞬间的悲伤
    2021-02-20 05:38

    It depends on the way you are saving your language across requests. If you are using a session to save your selected language in, you should use Application_AcquireRequestState, because since Application_BeginRequest is earlier in the life cycle, the session state object might not yet be available at this time.

提交回复
热议问题