I was reading a post A refresh button for asp.net pages by Peter Van Ooijen, and I am not sure if I agree with the implementation suggested by Peter in the article to refresh the page. It seems unnecessarily requires two server trips just to refresh the same page. It can, instead, easily be done with a single trip.
IMO, we can achieve page refresh action by just adding onclick
attribute to the button.
HyperLink1.Attributes.Add("onclick", "document.Form1.submit();");
Or, if you want a fresh instance of that page after refresh then add this script to onclick
event instead.
HyperLink1.Attributes.Add("onclick", "document.location='" + Request.Url.ToString() + "'");
You are right. This post describes your scenario
http://codebetter.com/blogs/peter.van.ooijen/archive/2006/05/19/144913.aspx
with a server side hyperlink
LikeLike