using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using EnterpriseNET.BusinessLogicLayer;

public partial class UserControls_right : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            try
            {
                string strSql = "";

                //绑定news
                strSql = "";
                strSql = "select top 5 NewsID,ClassID,NewsTitle,SeoDesc,PicPathSmall,AddTime from cai_News where len(PicPathSmall)>10 order by NewsID desc";
                DataView dvlist_news1 = News.QueryNews(strSql);
                rp_NewsList1.DataSource = dvlist_news1;
                rp_NewsList1.DataBind();

                Page.DataBind();
            }
            catch
            {
                Response.Write("发生错误.");
                Response.End();
            }
        }
    }

    protected string cutstr(string strChar, int intLength)
    {
        //取得自定义长度的字符串
        if (strChar.Length > intLength)
        {
            return strChar.Substring(0, intLength);
        }
        else
        {
            return strChar;
        }
    }
}