0
我想在我的gridview控件中實現分頁。下面是數據綁定代碼和pageindexchangedGridview分頁錯誤
Private Sub BindGrid()
Dim dataTable as DataTable = CType(Session.Item(APPLICATION_DATA), DataTable)
Grid.DataSource = dataTable.DefaultView
Grid.DataBind()
End Sub
Protected Sub OnChangePageSize(ByVal send As Object, ByVal e As GridViewPageEventArgs) Handles Grid.PageIndexChanging
Grid.PageIndex = e.NewPageIndex
_BindGrid()
End Sub
,但我得到的錯誤Grid.DataBind(後)爲
"Unable to cast object of type 'System.EventArgs' to type 'System.Web.UI.WebControls.GridViewPageEventArgs'"
爲什麼這個錯誤?任何幫助?