Skip to content

Asp.net Page life cycle

chetan bikire

chetan bikire

Asked Feb 6, 2014, 9:09 PM EST1 answer
Share
LinkedInX
why  you are used override keyword in asp.net page life cycle event which doesnt takes (object sender) parameter..?

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    When you create a class that inherits from the Page class, in addition to handling events raised by the page, you can override methods from the page's base class. For example, you can override the page's InitializeCulture method to dynamically set culture information. Note that when an event handler is created using the Page_event syntax, the base implementation is implicitly called and therefore you do not need to call it in your method. For example, the base page class's OnLoad method is always called, whether you create a Page_Load method or not. However, if you override the page OnLoad method with the override keyword (Overrides in Visual Basic), you must explicitly call the base method. For example, if you override the OnLoad method on the page, you must call base.Load (MyBase.Load in Visual Basic) in order for the base implementation to be run.


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