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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Manoj BhoirRank #599 · 4K reputationPosted May 8, 2015, 1:12 AM EDT
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 BiswasRank #992 · 2K reputationPosted May 8, 2015, 12:44 AM EDT
check this link to help..http://www.codeproject.com/Articles/68371/Detecting-Refresh-or-Postback-in-ASP-NET