Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            const string boxtname = "camnhanhome";
            var          zoneid   = ConvertUtility.ToInt32(ZoneDB.GetIDByFriendlyUrl(boxtname));

            if (zoneid <= 0)
            {
                return;
            }
            var info = ZoneDB.GetInfo(zoneid);

            if (info == null)
            {
                return;
            }

            lnkName.Text = info.Zone_Name;

            var realUrl = info.Zone_RealUrl;

            if (realUrl.Length > 0)
            {
                lnkName.NavigateUrl = lnkMore.NavigateUrl = realUrl;
            }
            else
            {
                lnkName.NavigateUrl = lnkMore.NavigateUrl = UrlFilter.BuildUrlByZoneID(info.Zone_ParentID);
            }

            var dtData = DistributionDB.GetContentRandomByZoneIDselfAndNumberRecord(zoneid, 1);

            if (dtData.Rows.Count <= 0)
            {
                return;
            }

            rptData.DataSource = dtData;
            rptData.DataBind();
        }