关于分页的全局变量
我做了一个分页程序,但多个人同时触发服务器的时候,分页的时候,出现问题,比如:10个人同时点击下一页了,当第11个人从第一页点击的时候,就直接跳到11了,我想可能是全局变量的问题。请高手指教,核心代码如下:
#region 用于首页的显示
protected void LinkButton1_Click(object sender, EventArgs e)
{
cpage = 1;
Pager pg = new Pager();
DataSet ds = new DataSet();
// ds = pg.GetCurrentDataSet( "Supply_id,Supply_name,Supply_area,Supply_type,Supply_Linkman,Supply_issuance ", " ", "Supply_id ", "supply ", 1, 30, cpage);
s_name = hidden1.Value;
s_sort = hidden2.Value;
s_prev = hidden3.Value;
if (s_name != " " || s_sort != " " || s_prev != " ")
{
ds = pg.GetCurrentDataSet( "Supply_id,Supply_name,Supply_area,Supply_type,Supply_Linkman,Supply_issuance ", s_name, s_prev, s_sort, "Supply_id ", "Supply ", 1, pagesize, cpage);
}
else
{
ds = pg.GetCurrentDataSet( "Supply_id,Supply_name,Supply_area,Supply_type,Supply_Linkman,Supply_issuance ", " ", " ", " ", "Supply_id ", "Supply ", 1, pagesize, cpage);
}
bind(ds);
Gethl();
DropDownList1.ClearSelection();
DropDownList1.Items.FindByValue(cpage.ToString()).Selected = true;
}
#endregion
#region 用于尾页的显示
protected void LinkButton4_Click(object sender, EventArgs e)
{
cpage = Last_Page + 1;
Pager