Solved

how to code an aspx page perform a page refresh when it is opened.

Posted on 2011-09-02
5
411 Views
Last Modified: 2012-06-22
How can you make sure that the browser will refresh (equivalent to F5) all css when a page is loaded.

I need to make sure that the cached version of the page does not get used.
0
Comment
Question by:JOHNFROG
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 30

Expert Comment

by:LZ1
ID: 36473349
You could try something like this in the head of your pages:
<meta http-equiv="Cache-control" content="no-cache">

Open in new window

0
 
LVL 16

Accepted Solution

by:
Rose Babu earned 500 total points
ID: 36474316
Hi,

try the below points

1. set Auto Refresh in page head. it will refresh the changes on css and page (300 = 5min)

<meta http-equiv="refresh" content="300">

2.  do below code in page_init or page_load

HttpContext.Current.Response.Cache.SetAllowResponseInBrowserHistory(False)
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache)
HttpContext.Current.Response.Cache.SetNoStore()
Response.Cache.SetExpires(DateTime.Now)
Response.Cache.SetValidUntilExpires(True)

3. Set some meta tags as follows

<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">

hope it may help you.
0
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 36476611
or simple rename the CSS file to something else...apply name change within HTML page and you should be good.
0
 

Author Comment

by:JOHNFROG
ID: 36477599
I have now attempted to implement each of the above except for adilkhans suggestion and still I must physically hit the F5 key to update a css change that was made in the same session.

I dont follow adilkhan? how is this to be done?

Currently I have a webform that will allow the user to change the contents of the background.jpg file that is referenced in the css. Once the change is selected the background image for the main web page remains the same as it was before the change was made. F5 needed to display the updated image.
0
 

Author Comment

by:JOHNFROG
ID: 36477968
Using chrome. strangely am seeing this solved for only a percentage of the time. Beginning to think this might be more browser behaviour than anything i can code
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Multi-Column Repeater 3 39
Need to find a web event on the IIS server 4 54
CSS styling problem 3 28
same domain, but different cookies. why? 6 12
CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

710 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