protected override void OnInit(EventArgs e) { base.OnInit(e); foreach (var attr in GetType().GetCustomAttributes(typeof(PageAttribute), true)) { _dosValidation = ((PageAttribute)attr).DoSValidation; _createUser = ((PageAttribute)attr).CreateUser; } if (_dosValidation && !ActionValidator.ValidateRequest(IsPostBack)) { Response.End(); } if (!_createUser) { return; } CurrentUser = WebUser.CreateUser(); if (!CurrentUser.bLoggedIn) { CurrentUser.LoginFromCookie(); } }
protected UserControl() { _webUser = WebUser.CreateUser(); if (!_webUser.bLoggedIn) { _webUser.LoginFromCookie(); } }