asp.net updatepanel 페이징 history.back
asp.net updatepanel 페이징 history.back
asp.net updatepanel 사용시 history.back 할 경우 페이징 상태를 저장합니다.
scriptmanager 에 enablehistory, onnavigate를 설정합니다.
cs 처리
protected int CurIndex
{
get
{
return ViewState["CurIndex"] != null ? Convert.ToInt32(ViewState["CurIndex"]) : 0;
}
set
{
ViewState["CurIndex"] = value;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
CurIndex = 0;
BindData();
}
}
protected void PagingControl_OnPageIndexChanged(object sender, PagingControl.PagingEventArgs e)
{
CurIndex = e.PageIndex ;
ScriptManager1.AddHistoryPoint("CurIndex", CurIndex.ToString());
BindData();
}
protected void ScriptManager1_Navigate(object sender, HistoryEventArgs e)
{
PagingControl.CurrentPageIndex = Convert.ToInt32(e.State["CurIndex"]);
BindData();
UpdatePanel1.Update();
}
from http://deuxist.tistory.com/518 by ccl(A) rewrite - 2020-03-06 07:55:13
댓글
댓글 쓰기