ASP.NET AJAX并保持会话的活 - 什么是标准的方式来做到这一点?这一点、方式、标准、ASP

2023-09-10 13:37:40 作者:迷糊的小猪

很久ASP.NET Web表单开发,新的Ajax开发(主要通过UpdatePanel控件!)。

Long time ASP.NET Webforms developer, new to Ajax development (mostly via the UpdatePanel control !).

由于没有回发都发生在服务器不重置用户的会话超时计数器,即使用户使用它的网页和清新的部分进行交互。

Since no postbacks are happening the server does not reset the user’s session timeout counter, even though a user is interacting with a page and refreshing parts of it.

我想知道什么是保持ASP.NET会话活动,当一个开发Ajax的UpdatePanel的简单和标准的方法;

I would like to know what is the simplest and standard way of keeping the ASP.NET session alive, when one is developing Ajax with the UpdatePanel;

请提供code和/或在你的答案的链接;的东西,我对搜索的框架,JQuery的,JSON会谈,无论是每月的首字母缩写的味道,我不需要任何幻想,这样做的只是简单的标准的方式,我不关心,如果它不优化等: - |

Please provide code and/or links in your answer; The stuff i searched talks about frameworks, JQuery, JSON, and whatever is the flavour of the month acronym, i don't need anything fancy, just the plain standard way of doing it, i don't care if it's not optimized, etc :-|

推荐答案

由于 GenericTypeTea 评论说,与使用.NET的UpdatePanel AJAX时,有服务器端回发。唯一的区别是,没有装载整个页面。所有的服务器侧code为触发为正常,但信息中使用AJAX技术以不同的方式在服务器和页之间传送。

As GenericTypeTea commented, there are server side postbacks when using .NET AJAX with UpdatePanel. The only difference is that the entire page is not loaded. All the server side code is triggered as normal, but the information is sent between the server and the page in a different way using the AJAX technology.

您甚至可以调用从客户端使用.NET调用PageMethods机制JavaScript的服务器端方法。这是使用AJAX在.NET中比传统的UpdatePanel技术的更手动方式。

You can even call server side methods from client side javascript using a mechanism that .NET calls PageMethods. This is a more "manual" way of using AJAX in .NET than the traditional UpdatePanel technique.