错误处理,会话过期策略阿贾克斯asp.net应用 [英] Error handling, Session expire strategy in ajax asp.net app

查看:115
本文介绍了错误处理,会话过期策略阿贾克斯asp.net应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人有多大ajaxy应用程序的任何战略或错误的整体操控性和会话过期想法?在传统的web应用程序时,一切是一个职位或得到的,很容易处理错误和会话过期和present友好的信息给用户。与其说与现代ajaxy Web应用程序。我的web应用程序使用ASP.Net Ajax的更新面板和WCF从各地各种页面调用。这些Ajax调用中的任何一个可以返回一个错误或用户的会话可能会过期。我所寻找的是一个单一的客户端组件,或一些可以辨认的时候出现错误,并显示用户友好的消息或识别时,会话超时,引导用户到登录页面。有什么人做了处理这类问题?

Does anybody have any strategy or ideas for overall handling of errors and session expiration in a big ajaxy application? In a traditional web application when everything was a post or get, it's easy to handle errors and session expiration and present friendly messages to users. Not so much with modern ajaxy web applications. My web app uses ASP.Net Ajax update panels and WCF calls from various pages throughout. Any one of those ajax calls could return an error or the user's session could be expired. What I am looking for is a single client side component or something that can recognize when there is an error and show the user a friendly message or recognize when session timed out and direct the user to the login page. What have people done to deal with this kind of problem?

推荐答案

会议的交换机在所有!这一建议有两个方面。

Switch of the session at all! This recommendation has 2 aspects.


  1. AJAX是没有这么快的技术,所以每微软建议,开关关闭会话提高了服务器端渲染时间

  2. 会议,与他们两个同时打开2页裂纹阿贾克斯交易。

您已经提到有关服务器侧的故障,并可以继续会话底片的列表。

You already mentioned about server side faults, and list of session negatives can be continued.

相反,检查您code,真正需要被存储在会话。
我是pretty确保您可以单独任何数据到2(神奇数字)存储:

Instead review you code, what really need to be stored in session. I'm pretty sure you can separate any data onto 2 (magic number) storage:


  1. 数据被永久客户端和服务器之间横向移动(会话密钥例如模拟)。让你自己的钥匙并保存在隐藏字段或饼干。 ViewState的也不错,但是对于优化使用我究竟是保存preFER控制。

  2. 数据收集的多个页面之间,很好的例子就是向导。在DB或用户的个人资料(DB坚持)从积累用户数据。对于我的项目,我们已经开发出在哪里用户节省了向导数据的特殊TempStorage表,如果由于某种原因用户尚未完成所有步骤3天表由工作清洗。

这篇关于错误处理,会话过期策略阿贾克斯asp.net应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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