Exemplo n.º 1
0
        protected override void OnLoad(EventArgs e)
        {
            Panel noLeaguePanel = (Panel)base.Master.FindControl("noleague_panel");

            if (noLeaguePanel != null)
            {
                noLeaguePanel.Visible = !IsLeagueSelected;
            }

            if (!Page.IsPostBack)
            {
                DropDownList leagueList = (DropDownList)base.Master.FindControl("league_list");
                if (leagueList != null)
                {
                    leagueList.Visible = true;

                    leagueList.DataSource = LeagueService.GetActiveLeagues();
                    leagueList.DataBind();
                    leagueList.Items.Insert(0, new ListItem("-- Choose a League --", ""));
                    leagueList.SelectedIndex = 0;

                    if (CurrentLeagueId > 0)
                    {
                        leagueList.SelectedValue = CurrentLeagueId.ToString();
                    }
                }
            }

            base.OnLoad(e);
        }
Exemplo n.º 2
0
        protected void BindLeagueGrid()
        {
            var leagues = LeagueService.GetActiveLeagues();

            league_grid.DataSource = leagues;
            league_grid.DataBind();
        }