Hello,
please help. thanks.
When I run the program and I get this error message when I click on the second page.
The GridView 'GridView1' fired event PageIndexChanging which wasn't handled.
I had page number on HTML like this:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="OrgCode"
PageSize="35" AllowPaging="True">
<Columns>
<asp:BoundField DataField="OrgCode" HeaderText="Agency" ReadOnly="True" SortExpression="OrgCode"
ItemStyle-Width="450px" />
<asp:BoundField DataField="Status" HeaderText="Status" />
</Columns>
</asp:GridView>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
lblMessage.Text = Session("message")
Select Case lblMessage.Text
Case "Administrative/Computer"
GetFieldwork("QAdministrativeComputers_sp")
Case "Child/Youth"
GetFieldwork("QChildYouthService_sp")
Case "Counseling"
GetFieldwork("QCounselingServices_sp")
Case "Elderly"
GetFieldwork("QElderlyService_sp")
Case "Families/Couples"
GetFieldwork("QFamiliesCouples_sp")
Case "Health Issues"
GetFieldwork("QHealthIssues_sp")
Case "Other Programs"
GetFieldwork("QOtherPrograms_sp")
Case "No Background Clearance Required"
GetFieldwork("QBGClearance_sp")
Case "Person with Disabilities"
GetFieldwork("QPersonDisabilities_sp")
Case "Recreation Programs"
GetFieldwork("QRecreationPrograms_sp")
Case "Substance Abuse"
GetFieldwork("QSubstanceAbuse_sp")
Case "Tutoring Serives"
GetFieldwork("QTutoringServices_sp")
Case "Paid Internship"
GetFieldwork("QPaidInternship_sp")
End Select
End Sub
Private Sub GetFieldwork(ByVal procedure As String)
Using con As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("DBHUSRConnectionString").ConnectionString)
Using cmd As SqlCommand = New SqlCommand(procedure, con)
cmd.CommandType = CommandType.StoredProcedure
Using sda As SqlDataAdapter = New SqlDataAdapter()
sda.SelectCommand = cmd
Dim dt As DataTable = New DataTable()
sda.Fill(dt)
GridView1.DataSource = dt
GridView1.DataBind()
End Using
End Using
End Using
End Sub