response.redirect afetr few seconds
-
I have a basic login page. when a user is logged in, I want him to be redirected to a page with a success message and after 3 seconds, I want him to be redirected to my home page. I know that I can use sleep time, but it's not recommended. So what's the best way to achieve it?
-
I have a basic login page. when a user is logged in, I want him to be redirected to a page with a success message and after 3 seconds, I want him to be redirected to my home page. I know that I can use sleep time, but it's not recommended. So what's the best way to achieve it?
I think you can implement through refresh tag under head section: You can use the META HTML tag to redirect the user. Below is an example:
OR Try with :
Response.AddHeader("REFRESH","10;URL=http://www.yourdomain.com");
Parwej Ahamad ahamad.parwej@gmail.com
-
I have a basic login page. when a user is logged in, I want him to be redirected to a page with a success message and after 3 seconds, I want him to be redirected to my home page. I know that I can use sleep time, but it's not recommended. So what's the best way to achieve it?
You can use Javascript if you want:
setTimeout( 'window.location = "default.aspx";', 3000 );
You can excute that script from anywhere even in your codebehind. Hope that helps