如何为多个控件添加一个事件处理函数?
各位大虾们:我有几个用来显示分页的LinkButton控件,我下面要对它们添加同一个事件处理函数,假如如下:
Sub PagerButtonClick(ByVal sender As Object, ByVal e As EventArgs)
'used by external paging UI
Dim arg As String = sender.CommandArgument
Select Case arg
Case "next"
If (DataGrid1.CurrentPageIndex < (DataGrid1.PageCount -1)) Then
DataGrid1.CurrentPageIndex += 1
End If
Case "prev"
If (DataGrid1.CurrentPageIndex > 0) Then
DataGrid1.CurrentPageIndex -= 1
End If
Case "last"
DataGrid1.CurrentPageIndex = (DataGrid1.PageCount - 1)
Case Else
'page number
DataGrid1.CurrentPageIndex = System.Convert.ToInt32(arg)
End Select
BindGrid()
ShowStats()
End Sub
请问一下我该怎么做才能实现? --------------------编程问答-------------------- 郁闷,没人回复
补充:.NET技术 , VB.NET