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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:02:50+00:00 2026-05-14T07:02:50+00:00

I got a master page with a server control in it. Randomly the server

  • 0

I got a master page with a server control in it. Randomly the server control is inaccessible from codebehind. This doesn’t happen on a specific action (eg a Button click or so). Currently I have no clue what this could be. I don’t think it’s output caching since this is not explcitly activated and the error happens far to seldom for that. But I’m going to disable caching in the master page explicitly with next deployment.

Anyone an idea how to find more info to find what’s happening? Or has someone had a similar error?

The control is defined in markup. The accompaning codebehind is:

PGFMainNavi.HasAccessToFunction = HasAccessToNaviItem;
// HasAccessToNavi is a local function

Exception is:

System.NullReferenceException: Object reference not set to an instance 
of an object

Thanks.

sa

  • 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-14T07:02:50+00:00Added an answer on May 14, 2026 at 7:02 am

    I have similar errors when I cache my controls – and I always check if their null, or if they are the correct types.

    I think that your control is cached somewhere.

    Use this code, to check that is not cached.

    if(PGFMainNavi != null)
    {
       PGFMainNavi.HasAccessToFunction = HasAccessToNaviItem;
    }
    

    or find where you set the case on this control and remove it.

    Second Solution

    Some times after an online update I get this error, because compiler did fail to read correct all involving files – probably some user read the page the same time I copy the files or something.

    To avoid that I always use the app_offline.htm before make my updates.

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

Sidebar

Related Questions

I've got a LinkButton control in a user control like this (Accordion is from
I've got a master page setup with a contentplaceholder control inside the title tag
I got this code in my Master page : <script type=text/javascript> $(#<%=hfJavaScriptDetected.ClientID %>).val('yes'); </script>
I have a page that's derived from a master page. On this page, I
on master file got ... <div id=nav-main> <asp:Menu ID=Menu1 runat=server DataSourceID=SiteMapDataSource1 Orientation=Horizontal Width=573px CssClass=menu-main
I've got two branches from my master: v2.1 : (version 2) I've been working
I've got an ASPX page set up that loads and displays dynamic data from
I've got a project that uses a Master Page. There is also a Content
I've got a master page which has a div as a border for the
I've got this code from Mads Kristensen's blog to display a message box on

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.