Friday, April 4, 2008

Page Auto-refresh for SharePoint

A problem with SharePoint is that to have it displayed, you always want current information.

Especially in a COC environment, if a significant event is entered by another user, you want the displayed SharePoint site to show the change.

There are two solutions. The first is to have a junior Marine hit the refresh button every 30 seconds...

...and as appealing as that sounds, there is a quick work around.

The Meta tag Refresh has been around for a long time. Often you see it when an old web page has moved to a new web page. You usually put the meta tag in the header of your page. The syntax is:

meta equiv="Refresh" content="n;url"

Where n is the number of seconds and the url is the url to refresh to. If you leave the url off then the page refreshes itself. Keep in mind that I should have a < and > on either side of the code above but could not due to blog restrictions.

You can add this line of code into any content editor web part, exactly as shown below...all you have to do is change the number of seconds you want the refresh to occur. For less critical pages you may want to extend the refresh rate to 60+ seconds.

For a 30 second refresh, copy/paste this code into your Content Editor Web Part...note that you will need to do this for every page you need to refresh unless you change this code in the Master Pages (info coming soon)...

meta equiv="Refresh" content="30"

Note again that you need to enclose this tag with < and >...

That's all you need...enjoy...

2 comments:

David Lozzi said...

Thanks for the post and great blog. I will be poking around!

I can't get this working in WSS. I simply added a content editor webpart to a list view, lists/testing/allitems.aspx, and pasted it in for 5 seconds (for the sake of testing) and the page never reloads.

I also tried adding the meta tag using JavaScript as seen on http://www.webmasterworld.com/javascript/3641390.htm with no luck.

Anything special I need to do?
Thanks,

Reach High Design said...

Hi Cool Blog. I tried your code and got no refresh. The following code id work:

meta http-refresh="Refresh" content="30"

Reach High Design