Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         lstAdvertises = AdvertiseService.Advertise_GetByTop("10", "", "");
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            lstAdvertises = AdvertiseService.Advertise_GetByTop("1", "", "");
            string chuoi = "";

            if (lstAdvertises.Count > 0)
            {
                chuoi += "<div class=\" item active \">";
                chuoi += "<img src=\" " + lstAdvertises[0].Image + " \"  />";
                //style =\" width:980px; height:277px \"
                chuoi += "<div class = \" carousel-caption \">";
                chuoi += "<h4>" + lstAdvertises[0].AdvName + "</h4>";
                chuoi += "<p>" + lstAdvertises[0].Content + "</p>";
                chuoi += "</div>";
                chuoi += "</div>";

                chuoi += "<div class=\" item \">";
                chuoi += "<img src=\" " + lstAdvertises[0].Image + " \"  />";
                chuoi += "<div class = \" carousel-caption \">";
                chuoi += "<h4>" + lstAdvertises[0].AdvName + "</h4>";
                chuoi += "<p>" + lstAdvertises[0].Content + "</p>";
                chuoi += "</div>";
                chuoi += "</div>";

                //for (int i = 0; i < lstAdvertises.Count; i++)
                //{
                //    chuoi += "<div class=\" item active \">";
                //    chuoi += "<img src=\" " + lstAdvertises[i].Image + " \" style =\" width:980px; height:277px \" />";
                //    chuoi += "<div class = \" carousel-caption \">";
                //    chuoi += "<h4>" + lstAdvertises[i].AdvName + "</h4>";
                //    chuoi += "<p>" + lstAdvertises[i].Content + "</p>";
                //    chuoi += "</div>";
                //    chuoi += "</div>";
                //    for (int j = i + 1; j <= lstAdvertises.Count; j++)
                //    {
                //        chuoi += "<div class=\" item \">";
                //        chuoi += "<img src=\" " + lstAdvertises[i].Image + " \" style =\" width:980px; height:277px \" />";
                //        chuoi += "<div class = \" carousel-caption \">";
                //        chuoi += "<h4>" + lstAdvertises[i].AdvName + "</h4>";
                //        chuoi += "<p>" + lstAdvertises[i].Content + "</p>";
                //        chuoi += "</div>";
                //        chuoi += "</div>";
                //    }
                //}
            }
            ltrBannerSilde.Text = chuoi;
            lstAdvertises.Clear();
        }
Пример #3
0
        void showlist()
        {
            List <Advertise> list = new List <Advertise>();

            list = AdvertiseService.Advertise_GetByTop("10", "", "");
            string chuoi = "";

            if (list.Count > 0)
            {
                chuoi += "<script type=\"text/javascript\">";
                chuoi += " var imagesDataArray = [";
                for (int i = 0; i < list.Count; i++)
                {
                    chuoi += "{";
                    chuoi += "src: '" + list[i].Image + "',";
                    chuoi += "url: '" + list[i].Link + "',";
                    chuoi += "target: '" + list[i].Target + "',";
                    chuoi += "description: '" + list[i].AdvName + "'";
                    chuoi += "},";
                }

                chuoi += "];";
                chuoi += " jQuery(function () {";
                chuoi += "$('#flipedge').shockwave(imagesDataArray, {";
                chuoi += "'slider-type': 'FlipEdgeSlider',";
                chuoi += "'tiles-in-x': 7,";
                chuoi += "'tiles-in-y': 1,";
                chuoi += "'fixed-rotation-axis': [1, 0, 0],";
                chuoi += "'controller-default-wave-origin': ['50%', '50%'],";
                chuoi += "'autostart-slideshow': true";
                chuoi += "});";
                chuoi += " })";
                chuoi += "</script>";
            }
            ltrslide.Text = chuoi;
        }