manage/留言管理/List.aspx.cs

(完整代码) 1KB

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.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

namespace 网上订餐系统.manage.留言管理
{
    public partial class List : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = "披萨先生网上订餐---菜单列表";
            int page;
            int.TryParse(Request.QueryString["p"], out page);
            if (page <= 0)
            {
                page = 1;
            }
            int recordCount;
            SqlServer db = new SqlServer();
            string condition = "";
            if (!string.IsNullOrEmpty(Request.QueryString["key"]))
            {
                condition += " 留言标题 like '%'+@key+'%'";
                db.AddSqlParameter("@key", Request.QueryString["key"]);

                //this.ltlSortName.Text += " > " + Request.QueryString["key"];
            }

            DataTable dt = db.GetPagingInfo("留言表", "留言ID,留言标题,留言时间", condition, "留言ID DESC", page, this.PagingBar2.PageSize, out recordCount);//取得分页数据

            //2 把信息绑定到repeater上面去
            this.rptList.DataSource = dt; //告诉repeater我们要显示的数据
            this.rptList.DataBind();  //数据绑定,显示出来
         

            //3 设置分页控件
            this.PagingBar2.CurrentPage = page;
            this.PagingBar2.RecordCount = recordCount;
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            Response.Redirect(Request.Url.AbsolutePath + "?key=" + this.tbSearchKey.Text);
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。