Page Load in Child Master Page

Last post 08-08-2008 7:43 AM by ShailAtlas. 1 replies.

Sort Posts:

  • Page Load in Child Master Page

    08-08-2008, 4:41 AM
    • Contributor
      4,773 point Contributor
    • naveenj
    • Member since 07-02-2007, 5:09 AM
    • India
    • Posts 871

    Hi Forum,

    I am using nested master page in my website.

    They are

    1. SiteMaster(the main master)

    2. CardsMaster( the child of SiteMaster)

    In this CardsMaster I have a gridview to bind Card Categories.

    Bound it on Page Load, but it was not working

    On debugging I came to know that Page Load Event doesn't even get raised for childmaster.Surprise

    My questions are

    1.Why is it so?(No Page Load Event gets raised for child master)

    2.Am I missing anything?(Is there a way to enable the PageLoad)

    3.Is there a work around for this?

    Regards,
    Naveen

    Please remember to click Mark as Answer on the post that helps you
    View Blog
  • Re: Page Load in Child Master Page

    08-08-2008, 7:43 AM
    Answer
    • Contributor
      2,247 point Contributor
    • ShailAtlas
    • Member since 07-18-2006, 1:07 PM
    • Norway
    • Posts 546

    Hello Naveen,
    It all has to do with the AutoEventWireup="true" Attribute. In case of Nested master page this is "false". Please set that to "true" to get the expected behaviour. Like for my Nested Master page in VS2008 I get page directive like this -

     

    1    <%@ Master Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="false"
    2    	CodeFile="MasterPage3.master.cs" Inherits="MasterPage3" %>
    
     
    Set Autoeventwireup to true also on Nested Master

    Thank You,
    Shail

Page 1 of 1 (2 items)