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

댓글

이 블로그의 인기 게시물

🐱‍💻Installing IIS Components Windows 10

2017년 1월 스타트업에서 구인할때 주로 원하는 개발 기술

Creating Cascading DropDownLists in ASP.Net (연속적인 셀렉트박스...