pageCount获取不到值。急急急急急急急急急急急急急急急急急
后台获取不到pageCount值。做的是分页功能
var pageCount = 1; //当前页
$(document).ready(function () {
$.post("FrontArticle_Cxneirong.aspx?name=next", { "pageCount": pageCount, "id": "<%=id %>" }, function (back) {
$('#neirong').html(back);
});
//下一页
$("#nextPage").click(function () {
pageCount += 1;
$.post("FrontArticle_B.aspx?name=next", { "pageCount": pageCount }, function (back) {
if (back == "lock") {
$('#nextPage').attr('disabled', "true");
}
else {
$('#neirong').html(back);
}
});
pageCount += 1;
})
});
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Discuz.Web.aspx._1
{
public partial class FrontArticle_Cxneirong : System.Web.UI.Page
{
public string bb = string.Empty;
public string ID = string.Empty;
protected void Page_Load(object sender, EventArgs e)
{
int id = Convert.ToInt32(Request["id"]);
cxneirong(id);
}
public string cxneirong(int id)
{
StringBuilder Str = new StringBuilder();
DataTable dt = Discuz.Data.DatabaseProvider.GetInstance().chuangxin(id);
string strtitle = dt.Rows[0]["title"].ToString();//strtitle标题
string strconten = dt.Rows[0]["doccnt"].ToString();//strconten内容
#region 查询
//foreach (DataRow dr in dt.Rows)
//{
// //string nei = string.Empty;
// //nei = getlenth(dr["doccnt"].ToString());
// Str.Append("<div>");
// Str.Append("<table>");
// Str.Append("<tr>");
// Str.Append("<td>"); Str.Append("<b>"); Str.Append(dr["title"]); Str.Append("</b>"); Str.Append("</td>");
// Str.Append("</tr>");
// Str.Append("<tr>");
// Str.Append("<td>"); Str.Append("<div id='picture' " + dr["doccnt"] + "<div>"); Str.Append("</td>");
// Str.Append("</tr>");
// Str.Append("</table>");
// Str.Append("</div>");
//}
//bb = Str.ToString();
//return bb;
#endregion
#region 分页
string b = String.Empty;
string a = strconten;//内容
string c = String.Empty;
int pageCount = Convert.ToInt32(Request.QueryString["pageCount"]);
string[] aSplit = a.Split(new string[] { "[page]" }, StringSplitOptions.None);
if (pageCount < aSplit.Length)
{
c = aSplit[pageCount].Replace("[page]&qu