怎的禁止gridview 换页的时候会触发RowCommand事件

怎样禁止gridview 换页的时候会触发RowCommand事件gridview 换页的时候会触发RowCommand事件,导致GridView

怎样禁止gridview 换页的时候会触发RowCommand事件
gridview 换页的时候会触发RowCommand事件,导致GridViewRow索引超出范围
[解决办法]
本帖最后由 net_lover 于 2011-07-29 09:39:55 编辑 protected void gvSubCate_RowCommand(object sender, GridViewCommandEventArgs e)
  {
    if (!e.CommandName.Equals("Page"))
    {
    int index = Convert.ToInt32(e.CommandArgument);
    GridViewRow row = gvSubCate.Rows[index];
    int id = Convert.ToInt32(row.Cells[0].Text);
    .......
    }

  }