Asp.Net MVC OnSessionStart event

后端 未结 1 1275
失恋的感觉
失恋的感觉 2020-12-13 08:55

I have found this thread which describes a very interesting OnSessionStart event, but I am unable to \"hook\" it up (whatever it means) to my global.asax.cs. I am also unsuc

相关标签:
1条回答
  • 2020-12-13 09:38

    It looks like this:

    void Session_Start(object sender, EventArgs e) {
      // your code here, it will be executed upon session start
    }
    

    It does work in Asp.net MVC.
    Put it as a method in the class defined in Global.asax.cs, for example just after the RegisterRoutes method.

    0 讨论(0)
提交回复
热议问题