Solved

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

Posted on 2006-06-12
1
234 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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

803 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