This post originated from an RSS feed registered with .NET Buzz
by Peter van Ooijen.
Original Post: A refresh button for asp.net pages
Feed Title: Peter's Gekko
Feed URL: /error.htm?aspxerrorpath=/blogs/peter.van.ooijen/rss.aspx
Feed Description: My weblog cotains tips tricks and opinions on ASP.NET, tablet PC's and tech in general.
Your browser has a back, forward and refresh button. Some time ago I wrote a little post on a back button to include on your own asp.net pages. According to the feedback you liked that one. Here I would like to share a refresh button. Quite simple but it works well!
You work with this code just like the back-button. This is the code
Also this one is a descendent of the linkbutton. When it's clicked it redirects the response to the url of the page itself. Which will start a new series of roundtrips. Your page will have it's initial state again.
The actual behavior is not quite the same as that of the browser's refresh buttonn
Before issuing the redirect any click handlers are invoked in the base.OnClick(). In there you could do some things to save work.
Due to the way the page lifecycle workspageload and other eventhandlers will be executed before the redirect. Using the browser button these will not fire. The page prerender will not fire.