// ModifiedBySolvion // bhi - 20.12.2011 // remember sort and search settings protected override void OnLoad(System.EventArgs e) { base.OnLoad(e); if (!Page.IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["SortField"])) { SortDirection dir = SortDirection.Ascending; if (!string.IsNullOrEmpty(Request.QueryString["SortDir"])) { if (Request.QueryString["SortDir"].ToLower() == "desc") { dir = SortDirection.Descending; } } MemberGrid.Sort(Request.QueryString["SortField"], dir); } if (!string.IsNullOrEmpty(Request.QueryString["PageIndex"])) { int pageIndex = 0; if (int.TryParse(Request.QueryString["PageIndex"], out pageIndex)) { MemberGrid.PageIndex = pageIndex; } } if (!string.IsNullOrEmpty(Request.QueryString["k"])) { SearchText.Text = Request.QueryString["k"]; UserDataSource.SearchText = SearchText.Text; } } }
//protected void Search_Click(object sender, System.EventArgs e) //{ // UserDataSource.SearchText = SearchText.Text; // MemberGrid.DataBind(); //} //protected override bool RequireSiteAdministrator //{ // get { return true; } //} // ModifiedBySolvion // bhi - 20.12.2011 // remember sort and search settings protected override void OnLoad(System.EventArgs e) { base.OnLoad(e); if (!Page.IsPostBack) { email = Request.QueryString["Email"]; linkExpireTime = Request.QueryString["linkExpireTime"]; string token = string.Concat(email.ToLower(), MyCustomMessageHandler.SecretGuid, linkExpireTime).GetHashCode().ToString(); if (token != Request.QueryString["token"]) { //Invalid Token SPUtility.TransferToErrorPage(LocalizedString.GetGlobalString("MyResource", "InvalidToken")); } else if (DateTime.UtcNow.Ticks > long.Parse(linkExpireTime)) { //link expired SPUtility.TransferToErrorPage(LocalizedString.GetGlobalString("MyResource", "LinkExpired")); } this.UserDataSource.ResetCache = true; if (!string.IsNullOrEmpty(Request.QueryString["SortField"])) { SortDirection dir = SortDirection.Ascending; if (!string.IsNullOrEmpty(Request.QueryString["SortDir"])) { if (Request.QueryString["SortDir"].ToLower() == "desc") { dir = SortDirection.Descending; } } MemberGrid.Sort(Request.QueryString["SortField"], dir); } if (!string.IsNullOrEmpty(Request.QueryString["PageIndex"])) { int pageIndex = 0; if (int.TryParse(Request.QueryString["PageIndex"], out pageIndex)) { MemberGrid.PageIndex = pageIndex; } } //if (!string.IsNullOrEmpty(Request.QueryString["k"])) //{ // SearchText.Text = Request.QueryString["k"]; // UserDataSource.SearchText = SearchText.Text; //} UserDataSource.IncludeSPSiteHiddenUserInfor = false; UserDataSource.MandatoryRowFilter = string.Format("Email LIKE '{0}'", email); UserDataSource.linkExpireTime = linkExpireTime; } }