locked
Newbie Problem - Found fix, but need to understand why.. RRS feed

  • Question

  • User1546138644 posted

    Hi,

    I am an ageing ex-C,C++ and VB programmer so not a complete noob to programming. However I am a complete noob to web programming having gone to the dark side (project management) around 15 years ago. After trying unsuccessfully to get my head around the LAMP stack a few years ago I decided to give it another crack with WebMatrix and ASP.NET etc...

    So I am working my way through the Web Development 101 stuff and loving it loads, despite the database id column "bug" obviously put in to trip up beginners like me! ;) Thanks to answers here it didn't keep me troubled for long. However today's has been a doozie.

    I am up to part 6 (http://www.microsoft.com/web/post/web-development-101-part-6-creating-an-add-data-page) and tried to do the exercise on that page as follows:

    "As an added exercise, you may have noticed that the 'Add a New Movie to the Database' text is styled differently from the rest. It's a <h1>, but it hasn't been styled the same way as the header h1. See if you can fix that. (Hint, the header h1 is considered a child of the <header> tag, but this isn't. What would you add to the CSS file to style this the same way?)"

    I tried and tried and tried... Nothing was working... Nothing was changing on the page no matter how I changed the CSS file... In the end I had to look at the answer further down the page... And there it was- simply add an <h1> style to the CSS. That isexactly what I had tried first!!!

    So I cut and pasted the html out of the exmaple into my own CSS, re-ran and still no change... nothing happened. It was as if the original CSS had been cached somewhere... In the end I rebooted my lappy, restarted WebMatrix and hey presto it all worked first time and the required changes had taken effect in the CSS. All is well...

    But why was the CSS file not dynamically reloaded after I edited it? I wasted an afternoon trying to figure out why my page wasn't changing, assuming I had used the wrong method in the wrong place or something, grrr. I have never had to reboot before to get edits to run so I can instantly see the results.

    Is there some trick to getting a cached CSS file flushed and reloaded?

    Tuesday, June 4, 2013 12:32 PM

Answers

  • User-821857111 posted

    Ctrl + F5 usually forces the browser to reload all the files pertaining to a page. However, Chrome can be more obstinate sometimes. If you are using Chrome, hit F12, then click the cog that appears in the bottom right corner and then click Disable Cache.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 4, 2013 4:07 PM

All replies

  • User-851967432 posted

    Not really a noob problem. Happens to me more times than I like to admit. I've never researched it but am convinced it's browser cache/cookie specific or at least clearning cache/cookies usually resolves it. I usually set my browser options to automatically clear cachce and cookies when closing so I don't have to be haunted by that problem.

    Tuesday, June 4, 2013 12:37 PM
  • User-821857111 posted

    Ctrl + F5 usually forces the browser to reload all the files pertaining to a page. However, Chrome can be more obstinate sometimes. If you are using Chrome, hit F12, then click the cog that appears in the bottom right corner and then click Disable Cache.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 4, 2013 4:07 PM
  • User281315223 posted

    The most common way to handle this is to simply use CTRL+F5, which will perform a hard refresh within your browser and should clear any of the cached files and force them to be accessed from the server again.

    Tuesday, June 4, 2013 4:08 PM
  • User1546138644 posted

    Thanks for your help all, I shall remember for next time it happens Cool

     

    Wednesday, June 5, 2013 4:22 AM