You are not Logged in
Would you like to Login or Register

Today is: Wednesday, 03 December, 2008
Check this months hot topics

Nested Master Page Events not being called

This is the second time I've been caught out by this little feature, so I thought I'd geekzilla it for both reference and to help others.

Scenario

I'm a big fan of MasterPages and Themes as a design principle for web development, and often you need to nest master pages to create complex repeatable layouts.

The Feature

In my child MasterPage I decided to put some code in the Page_Load to populate a related menu, and it wasn't being called....... very strange.. The Top level MasterPages' events were being called, but the child's weren't!

Solution

I'm not sure why it defaults to false but.. you need to change the AutoEventWireup property to true in the Master Directive in the MasterPage.

If this has caught you out, here's the solution.

kick it on DotNetKicks.com del.icio.us digg Mister Wong YahooMyWeb Reddit Furl Spurl blogmarks
Paul Marshall Skype
Author : Paul Marshall
Published : Thursday, 09 October, 2008

A self confessed Microsoft bigot, Paul loves all Microsoft products with a particular fondness for SQL Server. Paul is currently focusing on Web 2.0 patterns and practices and is always looking for better ways of doing things. I love the .net platform, and I find it to be the most productive toolset I have used to date.

Add Comment

Enter your comment below and it will be submitted for moderation.

Your Name

Add Tag

Please enter tags for this article, seperated by semi-colon ;

View Tag's by : # articles | # views