I want to create a button in visual studio that refreshes the entire browser page. Currently, I have a web part that is deployed onto sharepoint 2010. I would like to add a button to refreshes the page dynamically so that my web part content changes. It is because, my web part has a random code which changes information every 10 seconds, but to view the changes the page has to be refreshed constantly. I want to just add a button to my web part to hit refresh. Is it possible?
Share
There’s a few ways, but all use JavaScript on the button. Here’s my favourite:
The “type=button” prevents the button from causing a postback.
onclick="history.go()says to go to the last item in the history list, i.e. the current page.