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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:45:20+00:00 2026-05-31T14:45:20+00:00

I have created a control on my Site.Master page which pulls data from an

  • 0

I have created a control on my Site.Master page which pulls data from an external XML file to generate additional page content. This control relies on knowing which content page was loaded in order to select the correct content from the XML file. The control’s methods are launched from the Page_Load event handler in Site.Master.

The problem I’m having is that I don’t know how to determine (from the Site.Master page) which content page was loaded. I have tried using hidden fields on each content page, but because they have the same it causes conflicts in _Default. I could give them different names, but right now I can’t see a way to handle that without some ugly looking logic blocks. If I can’t find a good solution for this (which I’m sure must exist), I’ll have to settle for calling the control from every content page’s Page_Load handler. I suppose that’s not a terrible solution, but I’m trying to avoid code duplication if at all possible.

  • 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-31T14:45:21+00:00Added an answer on May 31, 2026 at 2:45 pm

    You can always get a reference to the current page(even in a static context) via HttpContext:

    public partial class SiteMaster : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Page p = HttpContext.Current.CurrentHandler as Page;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a master page in asp.net which dont have any server side
I have a Master Page which controls the styling of my site. In the
We have created a control that needs to persist data via the ViewState property
I have created a user control (CheckedDirTree) that exposes a CheckedFolder property which in
I have created a simple Asp.Net custom control which automatically combines all the correct
I have an AJAX-enabled SharePoint 2007 site. I have also created a user control
I have an ASP.NET Site that has a single Master Page. On one of
I have an ASP.NET site that uses a standard, wizard created login control. I
With the way my site is setup, I have a master page, page and
I have a SharePoint2010 site that I have created an ASP.NET menu control for.

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.