locked
Object life cycle - what is the order of events? RRS feed

  • Question

  • User-1166092990 posted

    I'm trying to better understand the life cycle of an object in the .Net framework.  My companies Intranet has some custom classes that were written by a vendor that I'm trying to make some modifications to.  Specifically I want to set some variables & hashtables to null when use of the object is done.  For now I have this in the dispose event.

    Is there any info you can point to that would be good reading on the life cycle of an object in the .Net framework?  I.e. what order do the events fire in?  OnInit, Initialize, finalize Dispose, etc.  I have the ASP.net page lifecycle but I'm not looking for that.

    If you can point me to some reference material I'd appreciate it.

    Thanks!

    Wednesday, January 13, 2010 1:10 PM

Answers

All replies

  • User2130758966 posted

    Hey,

    The page lifecycle and any control lifecycles are going to be somewhat intertwined in any discussion.

    I just found this page which shows complete master page, page, web control and user control lifecycles:

    For some of the really rare events you will probably have the best luck searching on MSDN:

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 13, 2010 1:28 PM
  • User606957779 posted

    Some very good explanation is available here:

    http://msdn.microsoft.com/en-us/magazine/bb985010.aspx

    http://msdn.microsoft.com/en-us/magazine/bb985011.aspx


    If you want to know more about IDisposable, I suggest reading this:

    http://www.codeproject.com/KB/dotnet/idisposable.aspx


    Wednesday, January 13, 2010 1:30 PM
  • User-833147438 posted

    You may want to try enabling tracing. That will give you a better understanding of what's going on with your page.

     

    Cheers!

    Wednesday, January 13, 2010 2:37 PM