问题描述:

Is it possible to make master page get called first instead of the called page - asp.net 4.0. I mean for example i have home page and i have master page. When i called the home page it goes to the home page code behind first then it goes to the master page code behind. Is it possible to call master page code behind first ?

ASP.net 4.0 , C# thank you

网友答案:

No, this is not possible.

The hierarchy is that the master page is actually nested within each content page.

The sequence of events is documented here.

网友答案:

If you have to write common function in each content page.You can avoid t by creating a base class and derive each content pages from that base class instead of the default base class System.Web.UI.Page

Other method as above mentioned write function in global.asax

相关阅读:
Top