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 8963593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:23:35+00:00 2026-06-15T16:23:35+00:00

So on my Default.aspx page I have several listboxes which I am populating on

  • 0

So on my Default.aspx page I have several listboxes which I am populating on page_load.

However, if the user changes these listboxes and wants to restore the original settings, I want a button at the top, which is defined in the Site.Master, to call this same function gain to restore the original values.

How can I obtain a reference to an instance of the _Default object from the Site.Master file? Is there a way to globally access the instance of _Default that is called when the page is first loaded? Or do I need to store that manually somewhere?

For example:

Default.aspx.cs:

namespace WebApplication1
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            setConfigurationData();
        }

        public void setConfigurationData()
        {
            //Do stuff to elements on Default.aspx

Site.Master.cs

namespace WebApplication1
{
    public partial class SiteMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void RefreshMenu1_MenuItemClick(object sender, MenuEventArgs e)
        {
            //Need to call this function from an instance of _Default, but I don't know
            //how to retrive this or save it from when it is first created

            //_Default.setConfigurationData();
  • 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-15T16:23:37+00:00Added an answer on June 15, 2026 at 4:23 pm

    Add this class scoped variable to your Master page

    private System.Web.UI.Page currentContentPage = new System.Web.UI.Page();
    

    Then add this method to your Master page

    public void childIdentity(System.Web.UI.Page childPage)
    {
        currentContentPage = childPage;
    }
    

    Now in the Page_Load of your Default page add

    SiteMaster masterPage = Page.Master as SiteMaster;
    masterPage.childIdentity(this);
    

    Now your master page should be able to access the objects on the Default page through the reference in its currentContentPage variable.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my aspx page I have a tr which is set visible=false by default.
I have a Default.aspx page in which I have bind a Grid. In the
I have Default.aspx page, which inherits from BasePage.cs, which inherits from System.Web.UI.Page. BasePage is
I have created a web page Default.aspx in which I have taken fields: First
On several occations, I have faced the situation that the default.aspx page on a
i have default.aspx page and one user control. usercontrol is having following code for
I have Default.aspx page, which inherits from BasePage.cs, which inherits from System.Web.UI.Page. BasePage is
In my .aspx page I have; <%@ Page Language=VB AutoEventWireup=false CodeFile=Default.aspx.vb Inherits=_Default AspCompat=True %>
I have an ASPX Page: <%@ Page Language=C# MasterPageFile=~/site.Master AutoEventWireup=true CodeBehind=Default.aspx.cs Inherits=myProject.Presentation.Web.Default src=Default.aspx.cs %>
I have an ASP.Net Page, aspx with its default form. I have a Submit

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.