protected void Page_Load(object sender, EventArgs e) {
{
{
pageCount = new News().GetNewsCount();
}
四、最主要的是ajax處理程序:PagerHandler.ashx
public class PagerHandler : IHttpHandler
{
public void context.Response.ContentType = "text/plain";
string str = string.Empty;
int pageIndex = Convert.ToInt32(context.Request["pageIndex"]);
if (pageIndex == 0)
{
int count = 0;
新聞 n = new News();
名單; list = n.GetNewsList(pageIndex, size, ref count);
StringBuilder sb = new StringBuilder(); sb.Append("< ; tr> ;
"); sb.Append(p.News_id); sb.追加(「" p.News_title ""); sb.Append("
|
"); 🎜> sb.Append(" |
"); sb.Append(p.News_readtimes); } str = sb.ToString(); context.Res
public bool IsReusable { return false; } |