Solved

Setting stylesheet in code behind file to alleviate style "flicker"

Posted on 2006-06-12
1
207 Views
Last Modified: 2012-08-14
Hi all,
I ve got a VS2005 web application which is using a single style sheet.
Originally I set the style sheet in the HTML itself using <link href="">. The style sheet has some basic settings for body font and table colors etc.
However when I load the page it is doing a weird flicker thing. It shows the page without formatting for a split second then it applies the style sheet and everything looks good.

I was wondering whether I could set the css in the page load event so that it occured before controls were loaded?
How do you set the pages style in code?
I tried         this.Page.StyleSheetTheme = "~/myStyle.css";  but it didnt apply any style.

Any ideas?
Thanks
D
0
Comment
Question by:CoreSupport
1 Comment
 
LVL 7

Accepted Solution

by:
here4u247 earned 125 total points
ID: 16884680
i'm not quite sure, but on header html block if the you add new tag with run-at=server, you should be able to modify that tag, i think!? also to change the CSS before the controls loads, then you need to change the CSS within OnInit() method

cheers

AM
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now