State Management(状态管理)

State Management refers to capability to store information.
主要有以下3种方式:
使用Application,可以存储管理Application scope 范围的data;
使用Session,可以存储管理User or Session 范围的 data;
使用Statebag,可以存储管理Web-Pagelevel级别的data,常用于web page PostBack 之间的Event用存储数据。
//
对于Application State Management:因为要使用服务器资源,所以适合存储经常访问的资源,不适合存储需要编辑处理的数据;Application State is Accessed and Maintained through the HttpApplicationState object,this object is first instantiated when a web application is first ran,this instance is accessed through the Application Property.如果使用Application存储大量的data,因为Data存储在服务器的Memory中,会导致服务器资源过度使用。如果需要在Application Scope 范围内存储大量的信息,可以使用Asp.Net Cache Management System。
//
对于Session,a single instance of HttpSessionState Class is created the first time when a client requests a url from within an Asp.net Web Application or site.

posted on 2005-06-27 12:20  Pierce  阅读(452)  评论(0)    收藏  举报

导航