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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:42:52+00:00 2026-06-04T04:42:52+00:00

I am converting a webapp from a frameset layout to Masterpage layout. Each of

  • 0

I am converting a webapp from a frameset layout to Masterpage layout. Each of the pages within the frameset use a common custom class to aquire the logged in user, this custom class inherits from Page.

I thought that an interface would be the proper way to convert this however I was really wrong. What is the best and most efficient means to store a global variable or class so that each content page for the Masterpage can reference the logged in user class?

  • 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-04T04:42:54+00:00Added an answer on June 4, 2026 at 4:42 am

    Make it a simple static class with static method that will return logged user class, there is no need to tie this code with ASP.NET page. If getting the logged on user requires some time vise expensive operations (like DB query for example) store logged user class instance in the session. Something like this :

    public static class Users
    {
    
      public static User GetLoggedUser()
      {
        if (HttpContext.Current.Session["LoggedUser"] != null)
        {
          return (User)HttpContext.Current.Session["LoggedUser"];
        }
        else
        {
          User usr = GetLoggedUserSomehow(); // here goes your current code to get user
          HttpContext.Current.Session["LoggedUser"] = usr;
          return usr;
        }
      }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm converting a webapp from mysql to SQL Server. Now I want to convert
I am converting an application from Flex to Javascript. My workflow within Eclipse for
Converting to ODB.NET from System.Data.OracleClient and need help converting my connection string. Here is
I am converting a script from PHP to ASP.net C#. In PHP, i could
I am converting a c# LINQ example: var query = from m in typeof(string).GetMethods()
I am converting an existing Tiles 1 webapp to Tiles 2 architecture. I am
I am in the process of converting a legacy application from proprietary technology to
Situation is pretty straightforward. I have a Java webapp that I'm converting to be
I am using a Firebird database to store Logs from an Web App. Each
Following Wicket 1.5's lead, I'm converting a project from Jetty 6.1.25 to 7.5.0.v20110901. My

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.