ActivEarth.Groups.Groups.Page_Load C# (CSharp) Method

Page_Load() protected method

Prepares the Groups table and Owned Groups table when the page loads. Redirects the user if they have not signed in.
protected Page_Load ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["userDetails"] == null)
            {
                Response.Redirect("~/Account/Login.aspx");

            }
            else
            {
                var userDetails = (User)Session["userDetails"];
                this.userID = userDetails.UserID;

                List<Group> userGroups = GroupDAO.GetGroupsByUser(this.userID);
                List<Group> ownedGroups = GroupDAO.GetAllGroupsByOwner(userDetails);

                if (userGroups.Count > 0)
                {
                    Color[] backColors = { Color.FromArgb(34, 139, 34), Color.White };
                    Color[] textColors = { Color.White, Color.Black };
                    GroupsDisplayTable1.PopulateGroupsTable(userGroups, backColors, textColors);
                    OwnedGroupsDisplayTable1.PopulateGroupsTable(ownedGroups, backColors, textColors);

                    GroupsDisplayTable1.Visible = true;
                    OwnedGroupsDisplayTable1.Visible = true;
                    EmptyGroup.Visible = false;
                }
                else
                {
                    GroupsDisplayTable1.Visible = false;
                    OwnedGroupsDisplayTable1.Visible = false;
                    EmptyGroup.Visible = true;
                }

            }
        }