ASP.NET MVC Beta - IE 7 browser not refreshed to CSS/Javascript changes in VS 2008 SP1

I think this might be useful to developers. I suspect this as a bug, hopefully it can be resolve soon. I can't find anyone talking about this on the internet. Maybe someone already posted this in the Microsoft Forum.If not, you can refer it here.

I was testing on ASP.NET MVC Beta on top of my Visual Studio 2008 SP1 earlier today until I spoted this issue. When I created a new ASP.NET MVC Application template, everything worked simply just fine. I could modify the existing Site.css and changed the body background-color to something else. It simply worked.

Now comes to the issue. When I started creating/modifying existing files within the generated template, my CSS/JavaScript would not work properly when I tried to do these as below:

a. Debug in IE 7 when pressing F5 in Visual Studio 2008 SP1

b. View in Browser on default.aspx

c. Browse with IE 7 (default)

** As for point c, it worked with FireFox 3.

I tried to change the background-color from 

background-color: #5c87b2;

to

background-color: #FFFFFF; OR  background-color: Orange;

It would only show the same original blue color. I had also added in JQuery for better UI navigations and it couldn't work. At first, I thought it could be the path issue for both JavaScript and CSS references in Site.master file. But it was not the cause.

When I tried to debug, it gave me this URL http://localhost:4944/. Then I made a wild guess, probably there could be a bug in Visual Studio 2008 for ASP.NET MVC Beta. So I copied that url and tested on a separate instance of IE. Now it works. It works in FireFox3 and other browsers too.

I am not sure whether this is a bug or anyone realizing it. I will ping Microsoft regarding this issue. Thanks.

8 Comments

  • Is it possible this is cached on the browser? Press Ctrl + F5 to ensure the browser refreshes all items and doesn't load anything from cache.

    From reading this it looks like a browser caching issue.


    Cheers
    Stefan

  • It sounds like IE7 was just showing the cached css file. What happens if you press Control+F5 in IE7, does the correct css then show?

  • Yeah. Ctrl + F5 will work. But I simply didn't realize it.

    Nevertheless, it is really hard though.

    a) You press F5 to debug
    b) then you press Ctrl + F5

    2 steps to do 1 thing. Many people might not knowing this especially when your applications grow too large. Thought it was some CSS problem or incompatibility thing. Wonder Microsoft can work out something to solve this caching issue with IE?

  • "Wonder Microsoft can work out something to solve this caching issue with IE?"

    This isn't a caching "issue" - it's a fundamental design pattern of a browser and it is working how it should. Browsers cache objects such as css, images and js files so that they don't have to be requested every time.

  • This isn't a caching "issue" - it's a fundamental design pattern of a browser and it is working how it should. Browsers cache objects such as css, images and js files so that they don't have to be requested every time.
    >> Noted. Well you have a valid point.
    >> But, my issue was still very related to ASP.NET MVC Beta project and IE 7 ...

    coz I had tested this with a normal ASP.NET Web Application. I didn't see this problem with IE 7. For accuracy, I tested in both IIS and localsystem.

    But why does this problem occurs only in ASP.NET MVC Beta project while debugging, view in browser or browse with? Something must be wrong somewhere?

    Any thoughts? I am open for opinion. Thanks everyone.

  • You could see that if you can try change images using ajax.
    It will get cached image where the actual image is updated but it will show a older one.
    For over come it I simply set cache off for particular page e.t.c from IIS setting

  • maybe your other test application had the development web server port set to "use random"
    different url, browser thinks it doesn't have it cached

    this really is general knowledge to everyone that ever edited css and pressed f5 to see his/her changes

  • Ctrl+f5 is working in that case(tried)
    Is there any changes that page not to be cached??

Comments have been disabled for this content.