次のボタンを何度も押した後、デバッグ メッセージは常に次のようになります。ページ 1 からページ 2 には移動できますが、ページ 3 には移動できません。
最後に私は問題が
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;
}
}