0

In web application, before redirecting to another page i want to display message! after few seconds it redirect to that page. For that i write code in scriptmanager like this..

     ScriptManager.RegisterStartupScript(this, GetType(), "mess", "<script> window.setTimeout('window.location='http://www.stackoverflow.com'; ',4000) </script>", false);

but it is not redirecting , can you help me , thank you.

2 Answers 2

1

Try this, will work

ScriptManager.RegisterStartupScript(this, GetType()
            , "mess", "<script> window.setTimeout(\"window.location='http://www.stackoverflow.com'\",4000) </script>", false);

Note: Self tested solution

Sign up to request clarification or add additional context in comments.

Comments

0

Hope this will work:

ScriptManager.RegisterStartupScript(this, GetType() , "mess", " window.setTimeout(\"window.location.href='http://www.stackoverflowcom'\",4000) ", false);

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.