public void lbDefault_Click(Object sender, EventArgs e) { var lb = (LinkButton)sender; var profileOldDefault = new UsersProfiles { UserID = UserID, IsDefault = 1 }; profileOldDefault.GetByUserIDAndDefault(); profileOldDefault.IsDefault = 0; profileOldDefault.Update(); var profile = new UsersProfiles { IsDefault = 1, ID = Convert.ToInt32(lb.CommandArgument) }; profile.Update(); Page.Response.Redirect("~/UserUI/ProfilesView.aspx"); }