代码改变世界

[转]Nested MasterPage Not Firing Page_Load Event

2010-02-14 15:10  AnyKoro  阅读(246)  评论(0编辑  收藏  举报

Nested MasterPage Not Firing Page_Load Event

I faced a situation today where I am trying to attach to the page_load event of a child nested master page to load some data on the master page itself. The event was not firing at all. Later on I figured out that the AutoEventWireup property on the Page directive is false!!!

Seems by default when you create a nested master page, its AutoEventWireup property is set to false! What you need to do is just make it true!

 

Hope this helps!

Regards

Published Thursday, March 27, 2008 1:42 AMbyBilalHaidar [MVP]Filed under: ASP.NET 2.0 - General, ASP.NET 3.5