开发者

Where the methods of Global.asax come from?

开发者 https://www.devze.com 2023-03-13 12:59 出处:网络
When I add Global.asax to the page, five methods (Application_Start,Session_Start,...) are added to the page automatically. But where they come from ? I loo开发者_运维百科ked at the application class

When I add Global.asax to the page, five methods (Application_Start,Session_Start,...) are added to the page automatically. But where they come from ? I loo开发者_运维百科ked at the application class and its interfaces but I couldnt find them at all.

Thanks in advance,


These methods don't come from anywhere, they exist only on your class. However, the ASP.NET runtime looks for methods in your class with these names and calls them at appropriate times in the application/page lifecycle.


Those events are bound by convention, see Life Cycle Events and the Global.asax file.


See this page under "Life Cycle Events and the Global.asax file"

http://msdn.microsoft.com/en-us/library/ms178473.aspx


Global.asax file having total 19 events and its all details you can fine much more on msdn...

0

精彩评论

暂无评论...
验证码 换一张
取 消