Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string sortBy = null;

            if (Request.QueryString["active"] == null)
            {
                _activeLetter = "A";
            }
            else
            {
                _activeLetter = Request.QueryString["active"];
            }

            if (Request.QueryString["sortBy"] == null)
            {
                sortBy = "a";
            }
            else
            {
                sortBy = Request.QueryString["sortBy"];
            }

            _sort = TryParseSortChannelsBy(sortBy);

            GetSortingLinks();

            BLClient client = null;

            // access the DB for most popular channels and bind "most popular" once
            if (!Page.IsPostBack)
            {
                try
                {
                    client = new BLClient();

                    MostPopular.DataSource = client.GetChannelMostPopular();
                    MostPopular.DataBind();
                }
                finally
                {
                    client.Dispose();
                }

                GetChannels();
            }

            Panel activeLetterPanel = GetActivePanel(_activeLetter);

            AddSortingInfoToAlphabet(sortBy);

            activeLetterPanel.CssClass = "ActiveLetter";
        }