using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BoyunBase;
using SiteCore;

public partial class Part_PicSlide_JS : System.Web.UI.UserControl
{
    protected void Page_Load( object sender, EventArgs e )
    {
        try {
            if( IsPostBack ) return;

            //读取数据
            ContentAccess ca = new ContentAccess( this, "TableName" );
            DataTable dt = ca.Read( "[*]", "name" );
            if( dt == null || dt.Rows.Count < 1 ) return;

            rptPics.DataSource = dt;
            rptPics.DataBind();

        } catch( Exception ex ) {
            Todo.DebugOut( "加载 Part_PicSlide_F 出现异常：" + ex.Message );
        }
    }
}

        /*string target = "";
        if( isOpenNew ) target = "_blank";
        else target = "_self";

        Todo.AddDataCol( "Target", dt );
        foreach( DataRow dr in dt.Rows ) {
            dr["Target"] = target;
        }
        img1.Src = dt.Rows[0]["ImgPath"].ToString();
        img2.Src = dt.Rows[1]["ImgPath"].ToString();
        img3.Src = dt.Rows[2]["ImgPath"].ToString();
        img4.Src = dt.Rows[3]["ImgPath"].ToString();
        img5.Src = dt.Rows[4]["ImgPath"].ToString();
        img6.Src = dt.Rows[5]["ImgPath"].ToString();
        img7.Src = dt.Rows[6]["ImgPath"].ToString();
        img8.Src = dt.Rows[7]["ImgPath"].ToString();
        img9.Src = dt.Rows[8]["ImgPath"].ToString();

        img1.Alt = dt.Rows[0]["linkTitle"].ToString();
        img2.Alt = dt.Rows[1]["linkTitle"].ToString();
        img3.Alt = dt.Rows[2]["linkTitle"].ToString();
        img4.Alt = dt.Rows[3]["linkTitle"].ToString();
        img5.Alt = dt.Rows[4]["linkTitle"].ToString();
        img6.Alt = dt.Rows[5]["linkTitle"].ToString();
        img7.Alt = dt.Rows[6]["linkTitle"].ToString();
        img8.Alt = dt.Rows[7]["linkTitle"].ToString();
        img9.Alt = dt.Rows[8]["linkTitle"].ToString();

        Link1.HRef = dt.Rows[0]["linkUrl"].ToString();
        Link2.HRef = dt.Rows[1]["linkUrl"].ToString();
        Link3.HRef = dt.Rows[2]["linkUrl"].ToString();
        Link4.HRef = dt.Rows[3]["linkUrl"].ToString();
        Link5.HRef = dt.Rows[4]["linkUrl"].ToString();
        Link6.HRef = dt.Rows[5]["linkUrl"].ToString();
        Link7.HRef = dt.Rows[6]["linkUrl"].ToString();
        Link8.HRef = dt.Rows[7]["linkUrl"].ToString();
        Link9.HRef = dt.Rows[8]["linkUrl"].ToString();
        /**/
        // Repeater1.DataSource = dt;
        //Repeater1.DataBind();
        //DataRow dr = dt.Rows[0];
        //string linkurl1 = Todo.Get("linkUrl", dr);
        //Todo.DebugOut("PictureFlash_PictureFlash   " + linkurl1);

        //link1.HRef = linkurl1;
        // img1.Src = Todo.Get("ImgPath", dr);
        //img1.Alt = Todo.Get("linkTitle", dr);
        //Todo.DebugOut(" PictureFlash_PictureFlash   " + Todo.Get("ImgPath", dr));

        // foreach(DataRow dr in dt.Rows){
        //if (contentPage != "")
        //    dr["LinkUrl"] = contentPage + Todo.Get("ID", dr);
        //else
        //    dr["LinkUrl"] = "";
        //dr["Target"] = Target;
        //if (isTimeVisable)
        //    dr["IssueTimeStr"] = Todo.TimeFormat(Todo.Get("IssueTime", dr), TimeFormat);

        //for (int i = 1; i <= 9; i++)
        //{
        //    DataRow dr = dt.Rows[0];
        //    //img1.Src = Todo.Get("ImgPath", dr);

        //   // img2.Src = Todo.Get("ImgPath", dr);
