Hi,
My project is developed on C#. There will be having lots of exceptions which are handled but some times some unexpected exceptions are shown so that I need to automatically refresh the page whenever the page shows error.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Manoj BhoirPosted May 8, 2015, 5:12 AM
You can use below code to refresh page.
Response.Redirect(Request.RawUrl);
Use Application_Error from your application Global.asax
protected void Application_Error(object sender, EventArgs e){ }
Final Code :
protected void Application_Error(object sender, EventArgs e)
{
Response.Redirect(Request.RawUrl);
}
Dipankar BiswasPosted May 8, 2015, 4:44 AM
check this link to help..http://www.codeproject.com/Articles/68371/Detecting-Refresh-or-Postback-in-ASP-NET