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

The Archive Base Latest Questions

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

I have an application where different users can log in via a single portal

  • 0

I have an application where different users can log in via a single portal login. When they log
in, if they belong to more than 1 company they have to select the company they belong to. The theme will change if there is a custom theme for that company.

Each page my application has inherits a “CustomPage” class

Here is the code for the custom page:

public class CustomPage : Page
{
    protected void Page_PreInit(object sender, EventArgs e)
    {
        if (Globals.Company != null && Directory.Exists(Page.MapPath("~/App_Themes/" + Globals.Company.CompanyName)))
        {
            Page.Theme = Globals.Company.CompanyName;
        }
        else
        {
            Page.Theme = "Default";
        }
    }
}

When the customer belongs to more than 1 company, and they select the company they belong to, the theme loads just fine.

So, the problem I am having is this:

If they belong to just 1 company, the company is automatically selected but the theme does not load right away. However, if I refresh the page, the theme loads just fine. Even the default theme will not load. The page has no css at all until I refresh.

I even view source and look for my css names and they are not there. I refresh and do the same thing, and they are there.

I am not using forms authentication and the default theme in the web config is “Default”

<pages theme="Default">

Any thoughts to what might be going on? If you need clarification on anything, please ask.

Thanks!

  • 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-15T18:10:41+00:00Added an answer on May 15, 2026 at 6:10 pm

    I found the problem. The Page_PreInit was being called before the Company information was being set during login.

    So after the user logged in, that is where I called the logic to check the company details versus in the master page load.

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

Sidebar

Related Questions

I have a web application that should behave differently for internal users than external
I have an application that has many different types of objects that each persist
we have an application that needs to send out various different types of template
In my application I have several DataContexts that connects to different databases with different
We currently have developed an application using WCF. Our clients make connections to different
I have two different ways of displaying items in a WPF application. The first
I have the requirement to support different Master pages on my application (ASP.NET MVC).
In our application we sometimes have to make minor GUI modifications for different customers:
I have a large .NET web application. The system has projects for different intentions
I'm working on a SaaS application where each customer will have different configurations depending

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.