By default the System.Web.UI.Page exposes Session, Request, and Response properties. However often you may want to access these properties outside of the Page context. The easiest way to do it is to use HttpContext.Current static property to obtain the current request’s HttpContext. Thus, you can obtain a session variable like this:
HttpContext.Current.Session[“userid”].
No comments:
Post a Comment