Click here to Skip to main content
15,886,006 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I got into some weird problem.

I have a page namely "Preview", which previews screen with latest settings(Previous page does all settings like font color, images upload...etc ). Soon after setting the preferences i'm generating a css file.

Now for the changes to take effect, everytime I have to do a CTRL+F5. HOW DO I DO THIS THRO CODE?

I've disabled cache and tried googling a lot.

Please help.

Note: Application built using MVC4, C#, VS2012. Tested on Chrome, IE, FireFox.


Regards
Vishnu Tej
Posted
Updated 22-Jul-13 0:57am
v2
Comments
bbirajdar 4-Jul-13 8:39am    
And the problem is ?
vishnutejcj 16-Dec-13 4:47am    
The Problem is to apply the newly generated CSS.. I started off by saying "I got into some weird problem" ...
vishnutejcj 16-Dec-13 4:47am    
The Problem is to apply the newly generated CSS.. I started off by saying "I got into some weird problem" ...
vishnutejcj 16-Dec-13 4:48am    
The Problem is to apply the newly generated CSS.. I started off by saying "I got into some weird problem" ...
AlphaDeltaTheta 5-Jul-13 3:03am    
Set cache-expires header to 1 or no cache at all.

1 solution

i've resolved this by myself...


JavaScript
<script type="text/javascript">
       window.onload = function () {
           if (!window.location.hash) {
               window.location = window.location + '#';
               window.location.reload(true);
           }
       }
  </script>


OR

JavaScript
<script type="text/javascript">
         window.onload = function () {
             if (window.location.hash == '') {             
                 window.location = window.location + '#hashrl';
                 window.location.reload(true);
             }
         }
    </script>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900