I am developing a webpart using VSTS 2008 + C# + .Net 3.5 + IIS 7.0 + A开发者_JAVA百科SP.Net. I want to refresh the whole page in my WebPart code, refresh I mean the same effect when user press F5 for browser.
I did not find a solution yet, any ideas?
Do it with javascript:
<a href="javascript:location.reload(true)">Refresh this page</a>
or if you want it automatically from the webpart, have it output code like this:
<script>
window.location.reload(true);
</script>
(this assumes you're not in a frame)
in a click event you could use:
Context.Response.Redirect(Context.Request.Url.GetLeftPart(UriPartial.Path));
精彩评论