Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asp.net delay before response redirect

Is it possible to delay the response.redirect in an asp.net page by 5 seconds?

something like delay.response.redirect("myURL.aspx")

I need to run a jquery animation before the page redirects.

I don't want to use meta refresh if I can help it but if that's the only way or the best way then please let me know.

thanks

like image 630
Tom Avatar asked Dec 17 '22 20:12

Tom


2 Answers

ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "click", "alert('Cliente cadastrado com sucesso.'); setTimeout(function(){window.location.href ='../../Default.aspx'}, 3000);", true);
like image 61
Jorge Avatar answered Feb 15 '23 12:02

Jorge


Response.AddHeader("REFRESH", "5;URL=http://redirectPage.aspx")

5 = delay in seconds.

like image 30
Jose G Avatar answered Feb 15 '23 10:02

Jose G