非.aspx/.aspx.cs 中引用Response,Request等使用类

非.aspx/.aspx.cs   中引用Response,Request等使用类请使用,

HttpResponse   resp   =   System.Web.HttpContext.Current.Response;
HttpRequest   req   =   System.Web.HttpContext.Current.Request;
HttpServerUtility   server   =   System.Web.HttpContext.Current.Server;
HttpSessionState   session   =   System.Web.HttpContext.Current.Session;
//   ....

所有这些使用类实例都作为Page中对应的实例属性公开

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章