0

I am having a change password page in that when the user change his password and click on submit i will show a message and will redirect to main form. But the text which i like to display is not displaying. What i need is i would like to have the page in the same form for few amount of time and then redirect to the desired one. Any idea please

I use the following code

 <script type="text/javascript">function LoadPage()

    {

   var v =setTimeout("MovePage()",5000); //will call the MovePage() function after 5 seconds

}
  function MovePage()

 {

      location.href='/FedData/newRoutingNumbervalidator.aspx';

      }
</script>

and for button i use the following OnClientClick="javascript:LoadPage();" this doesn't work for me

Developer
  • 8,390
  • 41
  • 129
  • 238
  • from ur question I came to know that you want to display some message after the user changes the password and after some time the page is redirected to some other page?. – kbvishnu Dec 18 '10 at 03:50

2 Answers2

2

You can use javascript setTimeout..

exa: setTimeout(function(){window.location.href = <YOUR_NEW_URL>}, 1000) //1000 ms
Chandu
  • 81,493
  • 19
  • 133
  • 134
  • Can i move to aspx page by giving some.aspx at .href – Developer Dec 18 '10 at 04:03
  • Yes, you can assign any valid URL even that of an external site. – Chandu Dec 18 '10 at 04:07
  • I edited my question with adding what i did can you tell what's the mistake in that – Developer Dec 18 '10 at 04:15
  • Is your application hosted as a root site or a virtual directory? Also can you specify what is teh error you are getting? If it is not a root site then you can't have your URL starting with "/", because it refers to root site and the URI would result in a 404 error – Chandu Dec 18 '10 at 04:21
  • No error is displaying but the page is not getting displayed if the same i use in body load it is working fine – Developer Dec 18 '10 at 04:26
  • Ok...thts weird... Is it possible to post the HTML of the page under question? – Chandu Dec 18 '10 at 04:30
  • You can use http://jsfiddle.net/ unless there is a way to post an attachment in SO. – Chandu Dec 18 '10 at 04:33
0

See if this helps you:

How to redirect to another webpage in JavaScript/jQuery?

How to manage a redirect request after a jQuery Ajax call

Community
  • 1
  • 1
johnny
  • 19,272
  • 52
  • 157
  • 259