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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:52:23+00:00 2026-05-22T17:52:23+00:00

In ASP.NET we have until now only had one theme, which was specified in

  • 0

In ASP.NET we have until now only had one theme, which was specified in the web.config. I recently started switching the Theme in the base page PreInit based on the Request.Url.Host value, say domain1.com was the original & we are now adding domain2.com with its own style. Since doing this all the <link rel="stylesheet...> tags are injected twice into the page. The domain1 ones which were always injected at the very start of the <head> section, then the <title> tag, followed by all the stylesheet link tags again for which ever theme is explicitly set in the page PreInit.

As I understand it ASP.NET will include every css file in the themes folder automatically, at which event in the page lifecycle does it do this?

  • 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-22T17:52:24+00:00Added an answer on May 22, 2026 at 5:52 pm

    Ok, so I found the issue, we were attaching to the PreInit event handler rather than overriding the OnPreInit method on the page, which resulted in this weird side effect. Seems that .NET does some funky magic in the preinit to setup the theme default from the web.config which doesn’t get fully overridden if you set the Theme property in the event handler rather than in the method. Most likely this is due to the fact that events don’t have a guaranteed order of execution so it’s happening either too early or too late.

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

Sidebar

Related Questions

I have a page in asp.net (web forms) that up until now only had
I have ASP.NET web pages for which I want to build automated tests (using
I am building a site in asp.net and have multiple subdomains. For example, one.cookies.com
I am working on a web app using C# and asp.net I have been
Does ASP.NET MVC have anything like the RESTful out-of-the-box features like Ruby on Rails
I am moving from classic ASP to ASP.NET and have encountered what many of
Is there anyway to have items in an ASP.NET DropDownList have either their Text
On a recent project I have been working on in C#/ASP.NET I have some
ASP.NET MVC routes have names when mapped: routes.MapRoute( Debug, // Route name -- how
So I have ASP.NET running on the server in IIS7. I think I'm going

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.