更新时间:2023-12-01 20:02:16
您可以使用的三个基本选项:查询字符串、会话、cookie.它们各有优缺点:
The three basic options at your disposal: query string, session, cookie. They each have their drawbacks and pluses:
一个关于设置页面索引的小代码片段.
A small code snippet on setting the page index.
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
try
{
if(HttpContext.Current.Request["myGVPageId"] != null])
{
myGridview.PageIndex = Convert.ToInt32(HttpContext.Current.Request["myGVPageId"]);
}
}
catch(Exception ex)
{
// log it
}
}
}