PageIndexChanging in GridView in ASP.NET

后端 未结 4 2096
我寻月下人不归
我寻月下人不归 2021-02-05 05:09

I have a gridview which I am using to display a dataset result. The problem is I am using paging in it. But when I click on the page # it says that I haven\'t handled the event.

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-05 05:46

    In VB.net, it does not have much difference with C#, you just remove the semicolons at the end of each line

    Private Sub myGridview_PageIndexChanging(sender As Object, e As GridViewPageEventArgs) Handles myGridview.PageIndexChanging
    
       LoadGridView() //Call your method to load the data into the grid.
       myGridview.PageIndex = e.NewPageIndex
       myGridview.DataBind()
    
    End Sub
    

提交回复
热议问题