protected override void AttachChildControls() { this.txtSearchText = (TextBox)this.FindControl("txtSearchText"); this.btnSearchButton = ButtonManager.Create(this.FindControl("btnSearchButton")); this.grdReferralmembers = (Common_Referral_MemberList)this.FindControl("Common_Referral_MemberList"); this.pager = (Pager)this.FindControl("pager"); this.btnSearchButton.Click += new EventHandler(this.btnSearchButton_Click); if (!this.Page.IsPostBack) { PageTitle.AddSiteNameTitle("会员中心首页", HiContext.Current.Context); MemberQuery query = new MemberQuery(); if (!string.IsNullOrEmpty(this.Page.Request.QueryString["username"])) { query.Username = this.Page.Server.UrlDecode(this.Page.Request.QueryString["username"]); } query.PageIndex = this.pager.PageIndex; query.PageSize = this.pager.PageSize; DbQueryResult myReferralMembers = PersonalHelper.GetMyReferralMembers(query); this.grdReferralmembers.DataSource = myReferralMembers.Data; this.grdReferralmembers.DataBind(); this.txtSearchText.Text = query.Username; this.pager.TotalRecords = myReferralMembers.TotalRecords; } }