Here I gave a tip about GridView and PagerTemplate:
![]()
http://forums.asp.net/t/1409011.aspx
and this tip is about saving pager index and sorting properties:
protected void Page_Unload(object sender, EventArgs e)
{
// Save grid view properties
Session["MainGVP"] = string.Format("{0};{1};{2}", grdRecords.SortExpression, grdRecords.SortDirection, grdRecords.PageIndex);
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// Load grid view here
// Set grid view properties
if (Session["MainGVP"] != null)
{
string[] Items = Session["MainGVP"].ToString().Split(';');
grdRecords.Sort(Items[0], (SortDirection)Enum.Parse(typeof(SortDirection), Items[1]));
grdRecords.PageIndex = int.Parse(Items[2]);
}
}
}
enjoy...