Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8908819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:16:49+00:00 2026-06-15T03:16:49+00:00

I have a HiddenField on my master page, and its value is set in

  • 0

I have a HiddenField on my master page, and its value is set in Page_Load event of the master page. In one of my content pages, I need this value in Page_Load event. So I added <%@ MasterType VirtualPath="~/Site.Master"%> to my content page, and created a property in the master page to read the hidden field’s value. But, the Page_Load events seem to be fired in reverse order, that is, first the content page, and then the master page, because my property is always an empty string. Here’s the code for my property read method and Page_Load event.

Site = public partial class(System.Web.UI.MasterPage)
  protected 
    method Page_Load(sender : object; e : EventArgs);
  private
    method GetCurrentCenter: String;
  public
    property CurrentCenter: String read GetCurrentCenter;
  end;

method Site.Page_Load(sender : object; e : EventArgs);
begin
  hfCurrentCenter.Value := '1';
end;

method Site.GetCurrentCenter: String;
begin
  Result := hfCurrentCenter.Value;
end;

And here’s the Page_Load event in my content page:

method ContentPage.Page_Load(sender : object; e : EventArgs);
var
  Center: DropDownList;
begin
  if Master.CurrentCenter <> '-1' then  // --< Master.CurrentCenter is always an empty string
  begin
    Center := DropDownList(cuWizard.CreateUserStep.ContentTemplateContainer.FindControl("Center"));
    Center.Enabled := False;
  end;
end;

Why is CurrentCenter always an empty string?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T03:16:50+00:00Added an answer on June 15, 2026 at 3:16 am

    I think your problem is related to page lifecycle. if you look at the order of firing of init and load events then you might get your answer.

    INIT_EVENTS:
    INIT_usercontrols
    INIT_MasterPage
    INIT_Page
    
    LOAD Events:
    Load :Page
    Load: MasterPage
    Load: UserControl
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used Ajax Accordion control on my Master Page on Page_Load event i
I have 2 textbox in my asp.net page and also have one hiddenfield in
I have 3 ASP.NET textboxes and one HiddenField. The value of the third textbox
I have a page that's derived from a master page. On this page, I
My pages base on master and content pages and in content pages I have
I have this asp:hiddenField control: <asp:HiddenField ID=AuxHiddenField runat=server/> I would like to trigger its
I have a master page in asp.mvc application. On this master page I have
I have an aspx master/content page scenario. The parent page has an IFrame which
I have a page that is based on a master page, the page has
I have a master page of SharePoint and in the master page I try

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.