Wednesday, November 30, 2005

You can save your data during a HttpRequest by passing it to System.Web.HttpContext.Current.Items[itemKey].
Objects stored in this Collection will be available during the whole lifecycle of the HttpRequest.

Example of usage:

System.Web.HttpContext.Current.Items["reloadCount"] = 5;

int reloadCount = (int) System.Web.HttpContext.Current.Items["reloadCount"];