protected void UserAccounts_RowUpdating(object sender, GridViewUpdateEventArgs e) { Guid id = (Guid)e.Keys[0]; GridViewRow row = UserAccounts.Rows[e.RowIndex]; string fullname = (row.FindControl("txtFullname") as TextBox).Text; string email = (row.FindControl("txtEmail") as TextBox).Text; string phone = (row.FindControl("txtPhone") as TextBox).Text; string comment = (row.FindControl("txtComment") as TextBox).Text; bool isApproved = (row.FindControl("chkIsApproved") as CheckBox).Checked; MembershipUser user = Membership.GetUser(id); if (user == null) return; user.Email = email; user.Comment = comment; user.IsApproved = isApproved; Membership.UpdateUser(user); aspnet_UserProfilesBLL bll = new aspnet_UserProfilesBLL(); bll.UpdateProfile(user.UserName, fullname, phone); //LinqDataSource1.DataBind(); }
protected void UserAccounts_RowUpdating(object sender, GridViewUpdateEventArgs e) { Guid id = (Guid)e.Keys[0]; GridViewRow row = UserAccounts.Rows[e.RowIndex]; string fullname = (row.FindControl("txtFullname") as TextBox).Text; string email = (row.FindControl("txtEmail") as TextBox).Text; string phone = (row.FindControl("txtPhone") as TextBox).Text; string comment = (row.FindControl("txtComment") as TextBox).Text; bool isApproved = (row.FindControl("chkIsApproved") as CheckBox).Checked; MembershipUser user = Membership.GetUser(id); if (user == null) { return; } user.Email = email; user.Comment = comment; user.IsApproved = isApproved; Membership.UpdateUser(user); aspnet_UserProfilesBLL bll = new aspnet_UserProfilesBLL(); bll.UpdateProfile(user.UserName, fullname, phone); //LinqDataSource1.DataBind(); }
protected void RegisterUser_CreatedUser(object sender, EventArgs e) { aspnet_UserProfilesBLL = new aspnet_UserProfilesBLL(); TextBox txtFullname = RegisterUser.FindControl("CreateUserStepContainer").FindControl("txtFullname") as TextBox; TextBox txtPhone = RegisterUser.FindControl("CreateUserStepContainer").FindControl("Phone") as TextBox; aspnet_UserProfilesBLL.NewProfile(RegisterUser.UserName, txtFullname.Text, txtPhone.Text); }