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 Models;
using LoveBLL;

namespace LoveWeb
{
    public partial class InviSouView : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
                PageBind();
                Label1.Text = "共搜索到" + (int)Session["inviNum"] + " 记录.";
            }
        }
        public void PageBind()
        {
            PagedDataSource pds = (PagedDataSource)Session["pds"];
            pds.AllowPaging = true;//设置PagedDataSource允许分页
            pds.PageSize = AspNetPager1.PageSize;//将PagedDataSource分页设置成ASPNetPaging的分页
            pds.CurrentPageIndex = AspNetPager1.CurrentPageIndex - 1;
            AspNetPager1.RecordCount = (int)Session["inviNum"];//获取所有的新闻记录条数
            DataList1.DataSource = pds;
            DataList1.DataBind();

        }
        public static string GetPartString(string invi_title, int num)
        {
            return InvitationManager.GetPartString(invi_title, num);
        }

        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {
            PageBind();
        }
    }
}
