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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:31:35+00:00 2026-06-12T10:31:35+00:00

My page is designed using two style sheets, form.css and styles.css, and I want

  • 0

My page is designed using two style sheets, form.css and styles.css, and I want to dynamically set their path based on the domain name.

Here is the code I wrote to change them dynamically. It works, but flickering occurs before switching to the new theme, How can I set the page styles and themes without using the Page.Theme property?

On Client Side

$(document).ready(function () {
    function preloadFunc() {
        var foldername = '<%= theme%>';
        $('#lnkCssForm').attr('href', 'css/' + foldername + '/form.css');
        $('#lnkCssStyles').attr('href', 'css/' + foldername + '/styles.css');
    }
    window.onpaint = preloadFunc();
});

On Server Side (On Page preInit)

theme = Session["domainTheme"].ToString();
  • 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-12T10:31:36+00:00Added an answer on June 12, 2026 at 10:31 am

    Why would you use javascript (and also on-dom-ready) for this? No wonder this causes “flicker”. Why not output the path directly from the template/partial/whatever that outputs the head with the style?

    <head>
       <link rel="stylesheet" type="text/css" href="css/<%= theme %>/form.css" media="all">
       <link rel="stylesheet" type="text/css" href="css/<%= theme %>/styles.css" media="all">
    </head>
    

    And what is the reason you don’t want to use Page.Theme for this? It’s exactly what this is meant for…

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

Sidebar

Related Questions

I have an html page with an area designed using css. I'm looking for
I have designed a page in Fireworks then imported it to Dreamweaver in CSS
My problem is that my menu which is designed using css and jQuery is
I have a dynamically generated html page which is designed to be printed. I
I've built a form using HTML and jQuery. The form is designed to generate
I've written a script that changes the CSS elements on a badly designed page.
I designed an dropdown sliding menu using jQuery. When on one page I added
Two related ASP.NET Web Service JSON questions here. I'm using a N-tier designed ASP.NET
I'm using html provided by a designer to create a master page. The html
I have an inherently complicated page designed by an idot running a script 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.