GridView控件采用了自动的分页方式,将所有的页数存在了Pagelist控件中.当点击Pagelist中的页码时出以下错误:
常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。源代码: Protected Sub PageDropDownList_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Pagelist.SelectedIndexChanged
' Retrieve the pager row.
Dim pagerRow As GridViewRow = grv用户.BottomPagerRow ' Retrieve the PageDropDownList DropDownList from the bottom pager row.
Dim pageList As DropDownList = CType(pagerRow.Cells(0).FindControl("PageDropDownList"), DropDownList) ' Set the PageIndex property to display that page selected by the user.
grv用户.PageIndex = pageList.SelectedIndex (出错的地方) End Sub请问如何解决?
常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。源代码: Protected Sub PageDropDownList_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Pagelist.SelectedIndexChanged
' Retrieve the pager row.
Dim pagerRow As GridViewRow = grv用户.BottomPagerRow ' Retrieve the PageDropDownList DropDownList from the bottom pager row.
Dim pageList As DropDownList = CType(pagerRow.Cells(0).FindControl("PageDropDownList"), DropDownList) ' Set the PageIndex property to display that page selected by the user.
grv用户.PageIndex = pageList.SelectedIndex (出错的地方) End Sub请问如何解决?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货