Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Master Page Page_Load not running
Message
From
19/08/2010 16:58:14
 
 
To
19/08/2010 16:52:20
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, United States
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01477409
Message ID:
01477415
Views:
30
>>Hi,
>>
>>I have a Master page where I put some code in the page_load in the code behind file. I also have code in the page_load of the content pages. How come the code in the master file does not run?
>>
>>What I am trying to do is programmatically set the Text of a label on the master page, every time any page based on this master page is displayed.
>
>Hmmm, it should work. Can you post the Page_Load event code from your Master page? Have you set your breakpoint in that method to make sure it truly wasn't running?

Here's the code in my IASLeftNav.Master.cs:
		protected void Page_Load(object sender, EventArgs e)
		{
            object UserPk = Session["mmUserSecurity_UserPk"];

            DataSet dsUser = mmAppBase.SecurityMgr.oUser.GetUserByPK(UserPk);
            string userFirstName = dsUser.Tables[0].Rows[0]["FirstName"].ToString();
            string userLastName = dsUser.Tables[0].Rows[0]["LastName"].ToString();

            this.lblCurrentUser.Text = userFirstName + " " + userLastName;
        }
I did set a breakpoint there and it never stopped.

Here's the setting in the aspx file:
< %@ Page Title="" Language="C#" MasterPageFile="~/IASLeftNav.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="SamaanSystems.IAS.Web.CustomerManager" % >
Frank.

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

Click here to load this message in the networking platform