Beispiel #1
0
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this.FillModuleList();
            }

            ArticlesList.Items.Clear();

            var articleController = new ArticleController();

            var newsArticlesModuleId = 0;
            var newsArcticlesTabId   = 0;

            if (ModuleListDropDown.Items.Count > 0)
            {
                var values = ModuleListDropDown.SelectedValue.Split(Convert.ToChar("-"));

                if (values.Length == 2)
                {
                    newsArcticlesTabId   = Convert.ToInt32(values[0]);
                    newsArticlesModuleId = Convert.ToInt32(values[1]);
                }
            }

            var articleList = articleController.GetArticleList(newsArticlesModuleId, true);

            foreach (var article in articleList)
            {
                var articleUrl = Globals.NavigateURL(
                    newsArcticlesTabId,
                    string.Empty,
                    string.Format("articletype=ArticleView&articleId={0}", article.ArticleID));

                ArticlesList.Items.Add(new ListItem {
                    Text = article.Title, Value = articleUrl
                });
            }
        }
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this.FillModuleList();
            }

            ArticlesList.Items.Clear();

            ArticleController articleController = new ArticleController();

            int newsArticlesModuleId = 0;
            int newsArcticlesTabId = 0;

            if (ModuleListDropDown.Items.Count > 0)
            {
                string[] values = ModuleListDropDown.SelectedValue.Split(Convert.ToChar("-"));

                if (values.Length == 2)
                {
                    newsArcticlesTabId = Convert.ToInt32(values[0]);
                    newsArticlesModuleId = Convert.ToInt32(values[1]);
                }
            }

            var articleList = articleController.GetArticleList(newsArticlesModuleId, true);

            foreach (var article in articleList)
            {
                var articleUrl = Globals.NavigateURL(
                     newsArcticlesTabId,
                    string.Empty,
                    string.Format("articletype=ArticleView&articleId={0}", article.ArticleID));

                ArticlesList.Items.Add(new ListItem { Text = article.Title, Value = articleUrl });
            }
        }