Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Master Page Page_Load not running
Message
From
21/08/2010 06:52:23
 
 
To
20/08/2010 19:09:31
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01477409
Message ID:
01477709
Views:
28
>>>Tim
>>
>>The problem I am having is with the nested master pages you created for me. I'm not sure if you have them lying around still, but this is the picture, maybe you could try it out .
>>
>>I have Default.aspx which has this in it:
>>
>>
< %@ Page Title="" Language="C#" MasterPageFile="~/IASLeftNav.Master" AutoEventWireup="true"
>>    CodeBehind="Default.aspx.cs" Inherits="SamaanSystems.IAS.Web.CustomerManager" % >
>>
>>So Default uses IASLeftNav.Master as its master.
>>
>>IASLeftNav.Master has this in it:
>>
>>
< %@ Master Language="C#" MasterPageFile="~/IASOuter.Master" AutoEventWireup="false"
>>    CodeBehind="IASLeftNav.master.cs" Inherits="SamaanSystems.IAS.Web.IASLeftNav" % >
>>
>>so it uses IASOuter.Master as its master.
>>
>>If I step through from the Default.aspx.cs's Page_Load, the IASLeftNav.Master.Page_Load never runs, but the Page_Load in the IASOuter.Master does run. I had thought that both would run so am trying to understand why the middle one is not running.
>
>
>I use nested masters on almost every ASP project so I can have different templates of design with the same outer heading and footer. I will use one of my projects to test your theory and see if I can give you and answer. I would like to know what code you are putting in the nested master page load event. That way I can test something similar to what you are trying to do.
>Thanks
>Tim

This is the code I tried in my IASLeftNav.Master Page_Load that didn't run:
            if (Session["mmUserSecurity_UserPk"] != null)
            {

                object UserPk = Session["mmUserSecurity_UserPk"];

                DataSet dsUser = mmAppBase.SecurityMgr.oUser.GetUserByPK(UserPk);
                string userFirstName = "Not";
                string userLastName = "Logged In";

                if (dsUser.Tables[0].Rows.Count > 0)
                {
                    userFirstName = dsUser.Tables[0].Rows[0]["FirstName"].ToString();
                    userLastName = dsUser.Tables[0].Rows[0]["LastName"].ToString();
                }
                this.lblCurrentUser.Text = userFirstName + " " + userLastName;
            }
But it didn't matter what code was there, when stepping through the code the debugger never even went to the Page_Load for this master page.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform