开发者

mvc redirect after delay

开发者 https://www.devze.com 2022-12-25 22:20 出处:网络
I\'m recently new in MVC technology and i\'m with a difficult I have a UI to create a user, and when i submit the content and all content is valid ipass a message into Viewdata[\"INFO\"] and return a

I'm recently new in MVC technology and i'm with a difficult

I have a UI to create a user, and when i submit the content and all content is valid i pass a message into Viewdata["INFO"] and return a View called Info with Viewdata Informing than the user was sucefully created.

But in this moment i want to Regist a some sc开发者_开发百科ript than, after a one delay specified the client redirects automatically to the base page "Users".

Any ideas to get the best way to do it?


Meta Refresh - See if this answers your question. You can specify a duration and location. Works on any browser as well!


You could just add a META REFRESH tag to the page dynamically.


I know that it is a bit late in comparison to the time this post was initially done, but just to make sure somebody finds this post beneficial.

Here is a JavaScript function that will redirect to the mentioned URL after five seconds:

  setTimeout(function() {
   window.location.href = "http://YourRespectiveUserBaseUrl/;" 
  }, 5000);
0

精彩评论

暂无评论...
验证码 换一张
取 消