1.UserControl (Pager1.ascx)
Partial Class Pager1 Public Event btnClick As EventHandler Protected Sub btnLAS_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLAS.Click '(此事件控制Page頁面元件) RaiseEvent btnClick(sender, e) End Sub End Class2.Page (bb.aspx.vb)
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load AddHandler Me.Pager1.btnClick, AddressOf pager1_btnClick End Sub Private Sub pager1_btnClick(ByVal sender As Object, ByVal e As EventArgs) '(控制Page頁面的code寫在這裡) 'page_index.Value = TryCast(Pager1.FindControl("Label1"), Label).Text - 1 End Sub
沒有留言:
張貼留言