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

  • Home
  • SEARCH
  • 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 8937915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:30:03+00:00 2026-06-15T10:30:03+00:00

In my SharePoint 2010 c# / asp.net site, I have a class defined like

  • 0

In my SharePoint 2010 c# / asp.net site, I have a class defined like

namespace PDF_Library.VisualWebPart1
{
    public partial class PDF_Library : Usercontrol   
    {
         public static PDF_Library current;
         protected void Page_Load(object sender, EventArgs e)
         {
              current = (PDF_Library)this; 
         }
    }
}


public static class Page_State
{
    public static Page is_display()
    {
        return PDF_Library.current.Page; // didn't work...
    }
}

It doesn’t have a constructor.
How can I get the reference to the current instance of this class?

I tried something like this in the top

public static PDF_Library current;

Then in a function it had

current = (PDF_Library)this;

But that didn’t work…

  • 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-15T10:30:05+00:00Added an answer on June 15, 2026 at 10:30 am

    You need to understand that it does not work this way. Your question is tagged with asp.net – multi-user, multi-threaded environment where multiple instances of PDF_Library user control will be created all the time. It is absolutely uncertain which one of them will be hanging off PDF_Library.current. You need to rethink your design.

    More on this: Page instance is disposed of when the request processing is finished. Normally this instance with all its controls and things such as Response, Request, Context etc will be set for garbage collection. Because you keep a reference to a UserControl instance in a static field, all these objects (including Page) will be kept in memory until this current reference is replaced with something else.

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

Sidebar

Related Questions

I am newbie in SharePoint 2010 but have experience in ASP.NET (C#) development. I
I have a webpart for SharePoint 2010 written on ASP.Net and I need to
Scenario : There is an ASP.NET site and the server also has sharepoint 2010
I'm building a webpart for SharePoint 2010 in ASP.NET and I would like to
I am working on solution for Sharepoint 2010 c# and asp.net and need to
We are looking for powerful UI control toolkit for ASP.NET SharePoint 2010. We want
I have asp.net web service application created in VS 2010. I created this web
I have a SharePoint2010 site that I have created an ASP.NET menu control for.
I am developing asp.net application for sharepoint 2010. I want to access sharepoint data
I'm considering publishing an an ASP.NET MVC 3 app under a SharePoint 2010 application

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.