CSS Woes

U

Uriah Piddle

Hi,

I'm new with ASP.NET 2 so please bear with me. I created a website with VS
2005 and enabled master pages and themes like this in WebConfig:

<pages masterPageFile="~/Template.master" theme="DefaultTheme" />

For several days I could edit the CSS file to format Template.master and
then all of a sudden, it quit and no matter what I do, the template uses the
settings in the CSS file as they existed two days ago. Even if I delete all
text in the CSS file, the settings still persist and are applied to the
Template. If I remove the reference to the theme, then the settings are gone
and the Template looses its formatting. I tried adding a reference to the
CSS file in the header of the Template page but that was no good either.

Please help. Thanks.

Steve
 
C

clintonG

// The .css file must be in the same folder as the Theme...

App_Themes <folder>
DefaultTheme <folder>
DefaultTheme.css

// The simple declaration of the Theme manages accessing and applying the
styles declared in the .css file.
<pages ... theme="DefaultTheme" />

// You can indeed test the Theme and the CSS stylesheet by removing the
theme attribute of the web.config pages section. Then declare the them is
each content page

<%@ Page
Language="C#"
CodeFile="..."
Inherits="..."
MasterPageFile="~/Masters/DefaultMaster.master"
Theme="DefaultTheme" %>

That's it. If you continue to "lose" state of the page display's style you
could be victimized by Visual Studio and/or ASP.NET bugs. There's quite a
number of performance and stability issues that persist. For me it was
really really bad on a previous machine that had Beta 2 installed before
installing RTM 2.0.
So what I learned is where to go to delete the cached build which exists
at...

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET
Files\<projectName>

Deleting that and then selecting rebuild from the Visual Studio menu clears
the cache of the compiled page class(es) which is how ASP.NET lays it claim
to fame to run fast once the intial compile has been performed. The SNAFU is
Windows puts file locks on the <projectName> directory and resources so a
reboot is often neccessary before Windows will allow us to delete the
<projectName> directory and contents.

Before doing that though I got into the habit of first rebuilding and then
tryhing to View in Browser before trying to delete any cache noting I
haven't been compelled to do so after rebuilding a new disk that never had
Beta 2 installed. As they say, your performance may vary...and that's all I
know what to say for now.

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
MAP 43°2'17"N 88°2'37"W : 43°2'17"N 88°2'37"W
 
C

Cowboy \(Gregory A. Beamer\)

Look in the theme directory and see if you have an OLD CSS file there. When
you are using theming, the CSS comes from the theme folder. if you think it
through, it makes perfect sense, as each theme will have a separate CSS
file. If you are linking to a CSS outside of the theme, or have edited a CSS
for another theme, you will not see the changes.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
 
U

Uriah Piddle

I declared victory too soon. The Rebuild All thing fixed it for one try but,
after that, the website would still not reflect the changes I had made in
the CSS file. A guy in the Wrox forum fixed it for me: you hit the Refresh
button your browser. The browser (IE) is running off the cached files in the
Temporary Internet Files folder which do not reflect the chages unless they
are refreshed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top