Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No LoadComplete for a MasterPage?

Tags:

asp.net

With AutoEventWireUp set to false, I would normally set a Page_Finalize like this:

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

LoadComplete however, doesn't seem to be available on a MasterPage and my Page_Finalize obviously doesn't get called.

What am I meant to do to free objects in the master page?

Thanks.

like image 861
webnoob Avatar asked Jan 21 '23 08:01

webnoob


1 Answers

LoadComplete method is simply not a member of MasterPage, but of Page.

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

It has three event-related methods: PreLoad, Load, LoadComplete. During Load, the Load event of children controls is triggered.

While a master page contains (by means of layout) the contents of the page, the page contains the MasterPage by means of objects, since the Page is the IHttpHandler that responds to HTTP requests in ASP.NET.

Briefly, you cannot override (I don't know Delphi, is that some kind of override?) OnLoadComplete in MasterPage as it's not defined. Only OnLoad

like image 188
usr-local-ΕΨΗΕΛΩΝ Avatar answered Jan 31 '23 08:01

usr-local-ΕΨΗΕΛΩΝ