开发者

how to trigger page refresh

开发者 https://www.devze.com 2022-12-14 17:55 出处:网络
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

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));
0

精彩评论

暂无评论...
验证码 换一张
取 消