如何在MVC中找到会话过期 [英] how to find Session Expiry in MVC

查看:75
本文介绍了如何在MVC中找到会话过期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在View.cshtml中跟随div:

I have follwing div : in View.cshtml

<div id="resultDiv">
 @{Html.RenderPartial("_AuthorizedProducts");}
 </div>



使用以下jquery重新加载div:



Reloading that div using following jquery:

$('#resultDiv').load('@Url.Action("authorizedProducts", "Admin")', { id: 0, userid: 0 });


会话过期时,我在div上显示以下错误.

{状态":{代码":超时","desc":会话超时"},数据":"/授权/注销"}

请提供解决方案.


When session expires I am getting the following error displayed on the div.

{"status":{"code":"TIMEOUT","desc":"Session Timeout"},"data":"/Authorization/LogOff"}

Please provide the solution.

推荐答案

(' #resultDiv ').load(' @ Url.Action("authorizedProducts","Admin")',{id: 0 ,用户ID: 0 });
('#resultDiv').load('@Url.Action("authorizedProducts", "Admin")', { id: 0, userid: 0 });


会话过期时,我在div上显示以下错误.

{状态":{代码":超时","desc":会话超时"},数据":"/授权/注销"}

请提供解决方案.


When session expires I am getting the following error displayed on the div.

{"status":{"code":"TIMEOUT","desc":"Session Timeout"},"data":"/Authorization/LogOff"}

Please provide the solution.


检查以下内容:

http://stackoverflow.com/questions/1490879/detecting-session-expiry- on-asp-net-mvc [ ^ ]
check this:

http://stackoverflow.com/questions/1490879/detecting-session-expiry-on-asp-net-mvc[^]


这篇关于如何在MVC中找到会话过期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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