Exemplo n.º 1
0
        protected void Page_Init(object sender, EventArgs e)
        {
            url = "http://" + Request.Url.Authority + Request.ApplicationPath + "/";
            //热门关键词
            string sHotKey_Alias = ConfigurationManager.AppSettings["HotKeyAlias"];

            divHotKey.InnerHtml = new DAL.CategoryDAL().GetHotKeyLite(sHotKey_Alias);

            //导航
            string    VoidGuid     = ConfigurationManager.AppSettings["Void_Guid"];
            string    VersionMark  = ConfigurationManager.AppSettings["Version_Mark"];
            DataTable NaviListData = DataQuery.GetNaviCategories(VoidGuid, "10", VersionMark);
            //TopNaviList.DataSource = NaviListData;
            //TopNaviList.DataBind();

            string ChannelAlias = null;
            string ChannelTitle = null;

            try
            {
                ChannelAlias = Request.QueryString["alias"].ToString();
            }
            catch
            {
                ChannelAlias = "gxchannel1";
            }
            ChannelTitle = DataQuery.GetNameByCategoryAlias(ChannelAlias);

            // 导视
            String    GuideAlias   = DataQuery.GetChannelAliasByName(ChannelAlias, "导视");
            String    GuideGuid    = DataQuery.CategoryAliasToID(GuideAlias);
            DataTable GuideCourses = new DAL.Article().GetArticleList(GuideGuid, true, 5);

            //Remove Html
            SlideShowPic.DataSource = GuideCourses;
            SlideShowPic.DataBind();
            SlideShowText.DataSource = GuideCourses;
            SlideShowText.DataBind();
            // 图片
            Level2Title.ImageUrl = "../images/" + ChannelAlias + ".png";
            //预告
            String TrailerAlias       = ConfigurationManager.AppSettings["ChannelTrailer"];
            string EnCodeChannelTitle = HttpUtility.UrlEncode(ChannelTitle, Encoding.GetEncoding("utf-8"));

            PreviewPic.ImageUrl = "../ShowBytePic.aspx?Title=" + EnCodeChannelTitle + "&Alias=" + TrailerAlias;
            String TrailerText = DataQuery.GetTrailerText(TrailerAlias, ChannelTitle);

            if (TrailerText != null)
            {
                TrailerText = TrailerText.Replace(";", ";");
                string[] TrailerInfo = TrailerText.Split(';');
                PreviewTitle.Text          = DataProcessing.SubstringText(TrailerInfo[0], 10);
                PreviewTitle.ToolTip       = TrailerInfo[0].ToString();
                PreviewSpeaker.Text        = TrailerInfo[1];
                PreviewSpeakerInfo.Text    = DataProcessing.SubstringText(TrailerInfo[2], 10);
                PreviewSpeakerInfo.ToolTip = TrailerInfo[2].ToString();
            }
        }
Exemplo n.º 2
0
        protected void Page_Init(object sender, EventArgs e)
        {
            url = "http://" + Request.Url.Authority + Request.ApplicationPath + "/";
            //热门关键词
            string sHotKey_Alias = ConfigurationManager.AppSettings["HotKeyAlias"];

            divHotKey.InnerHtml = new DAL.CategoryDAL().GetHotKey(sHotKey_Alias);

            //导航
            string    VoidGuid     = ConfigurationManager.AppSettings["Void_Guid"];
            string    VersionMark  = ConfigurationManager.AppSettings["Version_Mark"];
            DataTable NaviListData = DataQuery.GetNaviCategories(VoidGuid, "10", VersionMark);

            TopNaviList.DataSource = NaviListData;
            TopNaviList.DataBind();

            string ChannelAlias = null;
            string ChannelTitle = null;
            // 跳转&痕迹
            string CurrentPage = Path.GetFileName(Request.PhysicalPath);

            if (CurrentPage == "Level2Fame.aspx")
            {
                ChannelAlias             = ConfigurationManager.AppSettings["ChannelFame"];
                ChannelTitle             = DataQuery.GetNameByCategoryAlias(ChannelAlias);
                CurrentTrace.Text        = ChannelTitle;
                TraceLv2Link.NavigateUrl = "Level2Fame.aspx";
            }
            else if (CurrentPage == "Level2Class.aspx")
            {
                ChannelAlias             = ConfigurationManager.AppSettings["ChannelClass"];
                ChannelTitle             = DataQuery.GetNameByCategoryAlias(ChannelAlias);
                CurrentTrace.Text        = ChannelTitle;
                TraceLv2Link.NavigateUrl = "Level2Class.aspx";
            }
            else if (CurrentPage == "Level2News.aspx")
            {
                ChannelAlias             = ConfigurationManager.AppSettings["ChannelNews"];
                ChannelTitle             = DataQuery.GetNameByCategoryAlias(ChannelAlias);
                CurrentTrace.Text        = ChannelTitle;
                TraceLv2Link.NavigateUrl = "Level2News.aspx";
            }
            else
            {
                try
                {
                    ChannelAlias = Request.QueryString["alias"].ToString();
                }
                catch (Exception AliasNull)
                {
                    Response.Redirect("index.aspx");
                }
                if (ChannelAlias == ConfigurationManager.AppSettings["ChannelFame"])
                {
                    Response.Redirect("Level2Fame.aspx");
                }
                else if (ChannelAlias == ConfigurationManager.AppSettings["ChannelClass"])
                {
                    Response.Redirect("Level2Class.aspx");
                }
                //else if (ChannelAlias == ConfigurationManager.AppSettings["ChannelNews"])
                //{
                //    Response.Redirect("Level2News.aspx");
                //}
                else
                {
                    ChannelTitle             = DataQuery.GetNameByCategoryAlias(ChannelAlias);
                    CurrentTrace.Text        = ChannelTitle;
                    TraceLv2Link.NavigateUrl = "level2.aspx?alias=" + ChannelAlias;
                }
            }
            // 导视
            String    GuideAlias   = DataQuery.GetChannelAliasByName(ChannelAlias, "导视");
            String    GuideGuid    = DataQuery.CategoryAliasToID(GuideAlias);
            DataTable GuideCourses = new DAL.Article().GetArticleList(GuideGuid, true, 5);

            //Remove Html
            SlideShowPic.DataSource = GuideCourses;
            SlideShowPic.DataBind();
            SlideShowText.DataSource = GuideCourses;
            SlideShowText.DataBind();
            // 图片
            Level2Title.ImageUrl = "../images/" + ChannelAlias + ".png";
            //预告
            String TrailerAlias       = ConfigurationManager.AppSettings["ChannelTrailer"];
            string EnCodeChannelTitle = HttpUtility.UrlEncode(ChannelTitle, Encoding.GetEncoding("utf-8"));

            PreviewPic.ImageUrl = "../ShowBytePic.aspx?Title=" + EnCodeChannelTitle + "&Alias=" + TrailerAlias;
            String TrailerText = DataQuery.GetTrailerText(TrailerAlias, ChannelTitle);

            if (TrailerText != null)
            {
                TrailerText = TrailerText.Replace(";", ";");
                string[] TrailerInfo = TrailerText.Split(';');
                PreviewTitle.Text          = DataProcessing.SubstringText(TrailerInfo[0], 10);
                PreviewTitle.ToolTip       = TrailerInfo[0].ToString();
                PreviewSpeaker.Text        = TrailerInfo[1];
                PreviewSpeakerInfo.Text    = DataProcessing.SubstringText(TrailerInfo[2], 10);
                PreviewSpeakerInfo.ToolTip = TrailerInfo[2].ToString();
            }
        }