Events in Global.asax are not firing

前端 未结 5 1933
有刺的猬
有刺的猬 2021-01-19 03:27

In my ASP.Net application, I can\'t get the events in Global.asax to fire on my machine. For instance, Session_Start will not fire.

The same Global.asax works fine

5条回答
  •  终归单人心
    2021-01-19 03:51

    This is a long shot but I have been bitten by this before. When you created your Global.asax.cs file did you make sure to include a basic Global.asax file in your project?

    Also make sure that the inherits property in that Global.asax is pointing to your custom class (namespace and all) in your Global.asax.cs file.

    I had this problem once and it was because I totally forgot to make the Global.asax file and hook it up to my class. I had just copied the Global.asax.cs from another project that did something similar.

提交回复
热议问题