protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { //生成随机验证码 txtCrePar.Text = RndNum(Convert.ToInt16(4)); //加载时,绑定Reapter控件,显示新闻列表; string sql = "select infoId,infoTitle,typeName,infoBrowserCount,infoStat from uv_ips_infoDetail where 1=1 "; sql += "and typeStat='1' "; //类别状态正常 sql += "and infoStat='3' "; //查询已发布的信息 sql += "and infoEndtime<getdate() "; //下架日期在当前日期之后 sql += "order by infoTop,infoPublishtime"; //排序 UtIpsInfoDetail utIpsInfoDetail = new UtIpsInfoDetail(); DataTable dt = utIpsInfoDetail.getInfoListBySql(sql); rpInfoList.DataSource = dt.DefaultView; rpInfoList.DataBind(); } }