2
調試消息後,同樣是始終下面按下後下一個按鈕多次, 它可以從第1頁到第2頁,但不能去第3頁Session仍然編輯
終於讓我找到問題
Session["jobsearch"] = js;
已經得救了,但下一次我找回這一點,如不保存之前
調試消息
before js.CurrentPageNo=1
after js.CurrentPageNo=2
js.StartIndex=13
js.PageSize=24
js.TotalPageFound=5
js.CurrentPageNo=2
rowPerPage=12
before js.CurrentPageNo=1
after js.CurrentPageNo=2
js.StartIndex=13
js.PageSize=24
js.TotalPageFound=5
js.CurrentPageNo=2
rowPerPage=12
js.StartIndex=13js.PageSize=24js.TotalPageFound=5js.CurrentPageNo=2rowPerPage=12
js.StartIndex=13js.PageSize=24js.TotalPageFound=5js.CurrentPageNo=2rowPerPage=12
js.StartIndex=13js.PageSize=24js.TotalPageFound=5js.CurrentPageNo=2rowPerPage=12
js.StartIndex=13js.PageSize=24js.TotalPageFound=5js.CurrentPageNo=2rowPerPage=12
下一個按鈕代碼
protected void btnNext_OnClick(object sender, EventArgs e)
{
if (Session["jobsearch"] != null)
{
JobSearch js = (JobSearch)Session["jobsearch"];
js.CurrentPageNo++;
js.StartIndex = js.StartIndex + rowPerPage;
js.PageSize = js.PageSize + rowPerPage;
Session["jobsearch"] = js;
if (jobResultsTable.DocumentContent.Contains("Jobs In Engineering"))
{
Session["jobsearch2"] = "Jobs In Engineering";
}
else
{
Session["jobsearch2"] = "Jobs In IT";
}
System.IO.File.AppendAllText(@"D:\Debug.txt", "js.StartIndex=" + js.StartIndex);
System.IO.File.AppendAllText(@"D:\Debug.txt", "js.PageSize=" + js.PageSize);
System.IO.File.AppendAllText(@"D:\Debug.txt", "js.TotalPageFound=" + js.TotalPageFound);
System.IO.File.AppendAllText(@"D:\Debug.txt", "js.CurrentPageNo=" + js.CurrentPageNo);
System.IO.File.AppendAllText(@"D:\Debug.txt", "rowPerPage=" + rowPerPage);
GetJobSearchBOResult(js.StartIndex, js.PageSize, js.JobType, js.JobCountry, js.Keywords);
ShowButton(js.CurrentPageNo, js.TotalPageFound);
ltrPageInfo.Text = "Page " + js.CurrentPageNo + " of " + js.TotalPageFound.ToString() + "<br/> Total Record(s) Found: " + TotalJobFound;
}
}