控制器超时MVC 3.0 [英] Controller Timeout MVC 3.0

查看:84
本文介绍了控制器超时MVC 3.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在页面加载我得到当前日期时间,然后我需要后,在页面上1小时支出重定向用户。

On page load i get current Datetime , and then I need to redirect user after 1 hour spend on the page.

推荐答案

这是不是真的控制器逻辑,除非你正在使用异步控制器做一些异步工作服务器端。然后,你可以添加这个异步超时属性: [AsyncTimeout(3600000)

This isn't really controller logic unless you were using an async controller to do some async work server side. Then you could add this async timeout attribute: [AsyncTimeout(3600000)].

否则,我会做的JavaScript / jQuery的超时时间,我会设置一个计时器,一个小时之后就在js重定向或调用一个控制器来处理重定向。

Otherwise, I'd do the timeout in javascript/jquery where I'd set a timer and after one hour do redirect in the js or call a controller to handle the redirect.

这篇关于控制器超时MVC 3.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆