asp.net mvc - How to display message before redirecting to another page? -


i have problem... have registration form , when user has registred redirect him home page..i want display popup message before redirecting him successfuly registred , redirect him home page.

controller:

  tempdata["successmessage"] = "a confirmation email sent address you've entered shortly";           return redirecttoaction("index", "home"); 

view:

<script>  if (@tempdata["successmessage"] != null)   {     alert('@tempdata["successmessage"]');   } </script> 

store redirect url way

viewbag.redirect = "your url "; 

and java script mention below

<script>         if (@tempdata["successmessage"] != null)         {             alert('@tempdata["successmessage"]');              window.settimeout(function () {                 location.href = @viewbag.redirect;             }, 5000);          }         </script> 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -