打印本文 打印本文 关闭窗口 关闭窗口
ASP.NET管理状态的十种途径
作者:武汉SEO闵涛  文章来源:敏韬网  点击数835  更新时间:2009/4/23 10:47:06  文章录入:mintao  责任编辑:mintao

        HTTP协议是无状态的,ASP.NET提供了丰富的手段在页面之间管理状态。本文列举ASP.NET管理状态的十种途径。

        ASP.NET中,从System.Web.UI.Page继承的类里有以下十种管理页面状态的途径:
        1.  Application对象: this.Application
        2.  Session对象: this.Session
        3.  Cookie对象: this.Request.Cookies
        4.  查询字符串: this.Request.QueryString
        5.  Form变量和Hidden变量: this.Request.Params
        6.  Cache对象: this.Cache
        7.  ViewState对象: this.ViewState
        8.  HttpContext对象: this.Context.Handler及this.Context.Items
        9.  静态对象: 任何static类或static类成员
       10. Web.config配置节: ConfigurationSettings.AppSettings。

       小鸡射手最爱的方式是Cache,呵呵。

 

打印本文 打印本文 关闭窗口 关闭窗口