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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:10:30+00:00 2026-05-15T06:10:30+00:00

I have two pages page1.aspx and page2.aspx, both have code behind with partial classes.

  • 0

I have two pages page1.aspx and page2.aspx, both have code behind with partial classes.
How do i access public property message on page1.aspx from page2.aspx ?

public string message { get; set; }
  • 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-05-15T06:10:31+00:00Added an answer on May 15, 2026 at 6:10 am

    If the one is the Master page, and the other is the page that use the master.

    The Master Page

    <body>
        <form id="form1" runat="server">
        <div>
            <asp:Literal runat="server" ID="txtOnMaster"></asp:Literal>
            <br />
            <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">        
            </asp:ContentPlaceHolder>
        </div>
        </form>
    </body>
    

    and the code behind

    public partial class Dokimes_StackOverFlow_MasterPage : System.Web.UI.MasterPage
    {
        public string TextToMaster
        {
            get { return txtOnMaster.Text; }
            set { txtOnMaster.Text = value; }        
        }
    
    
        protected void Page_Load(object sender, EventArgs e)
        {
            // here I find the control in the client page
            Control FindMe = ContentPlaceHolder1.FindControl("txtOut");
    
            // and if exist I set the text to client from the master   
            if (FindMe != null)
            {
                ((Literal)FindMe).Text = "Get from Master Page";
            }
        }
    }
    

    and now the Page1.aspx that have the previus master page

    <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <asp:Literal runat="server" ID="txtOut"></asp:Literal>  
    </asp:Content>
    

    and the code

    protected void Page_Load(object sender, EventArgs e)
    {
        // here I set the text on master page from client
        ((Dokimes_StackOverFlow_MasterPage)Master).TextToMaster = "Set from Client";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

a have two aspx pages page1.aspx and page2.aspx . i have an href in
I have created two Pages Page1.xaml and Page2.xaml in windows8 metro apps. I have
I have two very similar .aspx pages. Both of them contain a DropDownList control.
I have two aspx pages: DashboardPreview.aspx: This is the homepage. It shows top 5
I have two pages, test1.aspx and test2.aspx test1.aspx has this protected void Page_Load(object sender,
I have two pages, NonMember.aspx and Member.aspx. If a user comes to the site,
I have two pages that inherit from one master page, First.aspx or second.aspx. Navigation
I have a main div on two pages ie page1.php and form.php page1.php <div
I've got two aspx pages which are very similar and have various identical functions
I have two pages. One aspx page and the other an aspx page but

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.