编译器错误信息: CS1502: 与“pager.MyDataGrid_Page(object, System.Web.UI.WebCo
写了个类文件里包含这个函数:public void MyDataGrid_Page(object sender, DataGridPageChangedEventArgs e)
{
int startIndex;
startIndex = MyDataGrid.CurrentPageIndex * MyDataGrid.PageSize;
MyDataGrid.CurrentPageIndex = e.NewPageIndex;
boxgo.Text = (MyDataGrid.CurrentPageIndex + 1).ToString();
boxgo_pre = boxgo.Text;
BindGrid();
ShowStats();
}
在aspx里调用这个函数的标签:
<asp:DataGrid ID="MyDataGrid" runat="server" OnPageIndexChanged="MyDataGrid_Page"
aspx.cs里的实例化:
pager def = new pager("select aname,qq from an_user", "anh", MyDataGrid);
def.MyDataGrid_Page(sender,e);
错误提示:
编译器错误信息: CS1502: 与“pager.MyDataGrid_Page(object, System.Web.UI.WebControls.DataGridPageChangedEventArgs)”最匹配的重载方法具有一些无效参数
行 32: def.MyDataGrid_Page(sender,e);