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...
精彩评论