You want to keep track of the "page" that your dataview thing is on right?
These are what I use, you should be able to modify them as you need.
(gvCompletedSites is a DataGridView, but the paging should be the same for whatever object you're using)
Bind a function like this to the pageIndexChanging event
-
protected void gvCompletedSites_PageIndexChanging(object sender, GridViewPageEventArgs e)
-
{
-
gvCompletedSites.PageIndex = e.NewPageIndex;
-
gvCompletedSites.DataBind();
-
Session.Add("gvC", e.NewPageIndex.ToString());
-
-
}
-
Put something like this Inside your page_load function
-
DataSet csites = null;
-
csites = GlobalManagerController.GetCompletedSites(mid, persontype);
-
gvCompletedSites.DataSource = csites;
-
try
-
{
-
if (Session["gvC"] != null)
-
{
-
gvCompletedSites.PageIndex = int.Parse((string)Session["gvC"]);
-
}
-
}
-
catch (Exception ee)
-
{//ignore?
-
-
}
-