Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Close a message box after some time and redirect to some web page

I am making a web page in C# and want to show a message box for 5 seconds and redirect the user to login.aspx if the entered information is true.

I have a register page and the user will try to register (email, username and password are required). I have a string Answer that if the entered information is ok, the value of the string is "OK" else "notOk".

So, how to add a message box telling "You have registered successfully" and after 5 seconds, close the message box and redirect it to login.aspx if string Answer = "OK"?

EDIT: I found this SITE here, it was very helpful. If anyone is interested in @LordTakkera 's last answer, this SITE explains how to call scripts.

like image 293
dnisko Avatar asked Dec 19 '25 01:12

dnisko


1 Answers

After registration has been successfully completed in server-side code, redirect to success.aspx which displays "You have registered successfully" to the user and has the following script in the markup:

<script>
  setTimeout(function() { window.location = "login.aspx"; }, 5000);
</script>
like image 199
Igor Avatar answered Dec 20 '25 16:12

Igor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!