void Page_Init(object sender, EventArgs e)
{
if (Session.IsNewSession)
{
Session["ForceSession"] = DateTime.Now;
}
this.ViewStateUserKey = Session.SessionID;
if (Page.EnableViewState)
{
if (!string.IsNullOrEmpty(Request.Params["__VIEWSTATE"]) &&
string.IsNullOrEmpty(Request.Form["__VIEWSTATE"]))
{
throw new Exception("Viewstate existed, but not on the form.");
}
}
}