12345图片滚动(动态读取后台数据)

 <div   class="boder">
            <script type="text/javascript">
             var focus_width=450;
             var focus_height=275;
             var text_height=24;
             var swf_height = focus_height+text_height;
             var pics='<%=imgurl %>';
             var texts='<%=imgtitle %>';
             var links='<%=links %>';
             document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
             document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#f7fbff">');
             document.write('<param name="menu" value="false"><param name="Loop" value="-1"><param name="wmode" value="opaque">');
             document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
             document.write('<embed src="focus.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#9ccfce" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
             document.write('</object>');
            </script>
        </div>

 

 

 

 

protected void Page_Load(object sender, EventArgs e)
    {
        BindImgData();
    }

    //绑定图片新闻
    public void BindImgData()
    {
        DataTable dt = new DataTable();
        dt = BLL.sen.GetImg(10, 6);//注意纳税服务图片ID
        string img = "";
        string text = "";
        string link = "";
        if (dt == null)
        {
            this.imgurl = "";
            this.links = "";
            this.imgtitle = "";
        }
        else
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                img += "|Files/images/" + dt.Rows[i]["url"].ToString();
                text += "|" + dt.Rows[i]["title"].ToString();
                link += "|" + "shownashuifuwuflashnews.aspx?id=" + dt.Rows[i]["id"];
            }
            this.imgurl = img.Substring(1, img.Length - 1);
            this.imgtitle = text.Substring(1, text.Length - 1);
            this.links = link.Substring(1, link.Length - 1);
        }
    }

 

posted @ 2010-03-24 11:54  洗碗心得  阅读(414)  评论(0编辑  收藏  举报