protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SueetieUIHelper.PopulateTimeZoneList(ddTimeZones); SetActiveButtonAttributes(CreateUserButton); lblResults.Visible = false; } }
private void Page_Load() { // check if username exists in the query string username = Request.QueryString["username"]; sueetieUser = SueetieUsers.GetUser(username); lblDisplayName.Text = sueetieUser.DisplayName; SueetieUIHelper.PopulateTimeZoneList(ddTimeZones, sueetieUser.TimeZone.ToString()); if (username == null || username == "") { Response.Redirect("users.aspx"); } // get membership user account based on username sent in query string _user = Membership.GetUser(username, false); lastActivitydate = _user.LastActivityDate; UserUpdateMessage.Text = ""; if (_user.IsLockedOut) { ActionMessage.Visible = true; ActionMessage.Text = "User is locked out. Use the \"Unlock User\" button to unlock"; } else { string bannedIntro = "This user's IP mask (" + SueetieIPHelper.GetIPMask(sueetieUser.IP) + ") is recorded as banned. Click 'Lift Ban on this User' to permit the user to login or create a new account."; string unbannedIntro = "User is not banned. Click 'Ban User' to record user's IP mask as banned to thwart attempts to create new site accounts."; if (!Page.IsPostBack) { if (sueetieUser.IsBanned) { trBan.Visible = false; lblBannedIntro.Text = bannedIntro; } else { trUnBan.Visible = false; lblBannedIntro.Text = unbannedIntro; } SueetieUserProfile profile = SueetieUsers.GetSueetieUserProfile(sueetieUser.UserID); txtDisplayName.Text = profile.DisplayName; chkNewsletter.Checked = profile.Newsletter; } _user.LastActivityDate = lastActivitydate; Membership.UpdateUser(_user); _user = Membership.GetUser(username, false); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SetActiveButtonAttributes(CreateUserButton); if (Request.IsAuthenticated) { Response.Redirect("/default.aspx"); } else if (SueetieContext.Current.SiteSettings.RegistrationType == (int)SueetieRegistrationType.Closed) { // temporary redirect to enable during site updates or when you do not want new users to register Response.Redirect("/members/message.aspx?msgid=4"); } SueetieUIHelper.PopulateTimeZoneList(ddTimeZones); registrationType = (SueetieRegistrationType)SueetieContext.Current.SiteSettings.RegistrationType; InitializeCaptcha(); CreateUserButton.Text = SueetieLocalizer.GetString("register_createuserbutton_text"); RegularExpressionDisplayNameValidator.Text = SueetieLocalizer.GetString("register_validator_displayname"); if (string.IsNullOrWhiteSpace(RegularExpressionDisplayNameValidator.Text)) { RegularExpressionDisplayNameValidator.Text = "Erreur"; } RegularExpressionUsernameValidator.Text = SueetieLocalizer.GetString("register_validator_username"); if (string.IsNullOrWhiteSpace(RegularExpressionUsernameValidator.Text)) { RegularExpressionUsernameValidator.Text = "Erreur"; } RegularExpressionEmailValidator.Text = SueetieLocalizer.GetString("register_validator_email"); if (string.IsNullOrWhiteSpace(RegularExpressionEmailValidator.Text)) { RegularExpressionEmailValidator.Text = "Erreur"; } RegularExpressionPasswordValidator.Text = SueetieLocalizer.GetString("register_validator_password"); if (string.IsNullOrWhiteSpace(RegularExpressionPasswordValidator.Text)) { RegularExpressionPasswordValidator.Text = "Erreur"; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { txtSiteName.Text = SiteSettings.Instance.SiteName; chkCreateWikiAccount.Checked = SiteSettings.Instance.CreateWikiUserAccount; chkRecordAnalytics.Checked = SiteSettings.Instance.RecordAnalytics; txtGroupsFolderName.Text = SiteSettings.Instance.GroupsFolderName; txtIpGeoLookupUrl.Text = SiteSettings.Instance.IpGeoLookupUrl; rblRegistrationType.Items.Add(new ListItem("Automatic", "0")); rblRegistrationType.Items.Add(new ListItem("Email Verification", "1")); rblRegistrationType.Items.Add(new ListItem("Administrative Approval", "2")); rblRegistrationType.Items.Add(new ListItem("Closed", "3")); rblRegistrationType.Items.FindByValue(SiteSettings.Instance.RegistrationType.ToString()).Selected = true; lblVersion.Text = SiteStatistics.Instance.SueetieVersion; txtDefaultLanguage.Text = SiteSettings.Instance.DefaultLanguage; rblWwwSubdomain.SelectedValue = SiteSettings.Instance.HandleWwwSubdomain; SueetieUIHelper.PopulateTimeZoneList(ddTimeZones); } }
protected void Page_Load(object sender, EventArgs e) { ScriptManager1.RegisterPostBackControl(UpdateUpload); ScriptManager1.RegisterPostBackControl(DeleteAvatarButton); ScriptManager1.RegisterPostBackControl(btnUpdateBio); ScriptManager1.RegisterPostBackControl(ChangePasswordButton); if (Request.QueryString["dv"] == "1" || Request.QueryString["av"] == "1" || Request.QueryString["iv"] == "1") { TabContainer1.ActiveTabIndex = 2; } else if (Request.QueryString["bio"] == "1") { TabContainer1.ActiveTabIndex = 2; } else if (Request.QueryString["pr"] == "1") { TabContainer1.ActiveTabIndex = 0; } else { TabContainer1.ActiveTabIndex = 0; } if (!Page.IsPostBack) { if (Page.User.Identity.IsAuthenticated) { SueetieUser sueetieUser = SueetieUsers.GetUser(CurrentUserID, false); SetActiveButtonAttributes(CancelButton); SetActiveButtonAttributes(ChangePasswordButton); SetActiveButtonAttributes(btnUpdateProfile); SetActiveButtonAttributes(btnUpdateBio); SueetieUIHelper.PopulateTimeZoneList(ddTimeZones, sueetieUser.TimeZone.ToString()); SueetieUserProfile profile = CurrentSueetieUser.Profile; txtCurrentPassword.Text = string.Empty; txtDisplayName.Text = sueetieUser.DisplayName; txtEmail.Text = sueetieUser.Email; #region Optional Profile Property Assignments if (chkNewsletter != null) { HasNewsletterCheckBox = true; chkNewsletter.Checked = profile.Newsletter; } #endregion // When using ProfileBase... //ProfileBase profile = HttpContext.Current.Profile; //txtDisplayName.Text = profile["DisplayName"] as string; //ddlGenders.SelectedValue = profile["Gender"] as string; //ddlOccupations.SelectedValue = profile["Occupation"] as string; //txtWebsite.Text = profile["Website"] as string; //txtTwitterName.Text = profile["TwitterName"] as string; //ddlCountries.SelectedValue = profile["Country"] as string; txtBio.Text = sueetieUser.Bio; } } BindData(); }