No LoadComplete for MasterPage?

With AutoEventWireUpset to false, I would usually set Page_Finalizelike this:

Include(Self.LoadComplete, Self.Page_Finalize); //Delphi

LoadCompletehowever, it does not seem to be available on MasterPage, and mine is Page_Finalizeclearly not invoked.

What did I want to do to free objects on the main page?

Thank.

+3
source share
2 answers

LoadCompletethe method is simply not a member MasterPage, but Page.

There are several reasons for this, including the fact that Pagethe class itself is the orchestra of the page life cycle .

He has three event-related methods: PreLoad, Load, LoadComplete. During, the Loadevent of the Loadchild controls is fired .

( ) , MasterPage , Page - IHttpHandler, HTTP- ASP. NET.

, ( , Delphi, - ?) OnLoadComplete MasterPage, . OnLoad

+5

, Page.LoadComplete , , .

:

protected void Page_Load(object sender, EventArgs e) {
    Page.LoadComplete += Page_LoadComplete;
}

protected void Page_LoadComplete(object sender, EventArgs e) {
    // do stuff on LoadComplete in the master page
}
0

Source: https://habr.com/ru/post/1795447/


All Articles