How to trap usercontrol click event in aspx page
-
Hi, I have a created a user control (pagination for grid) in my application. It has four Imagebuttons. I need to trap the click event of these imagebutton outside of the user control and only in my aspx page. I am currently working on .Net 2.0. Please show me the way, Thanks,
-
Hi, I have a created a user control (pagination for grid) in my application. It has four Imagebuttons. I need to trap the click event of these imagebutton outside of the user control and only in my aspx page. I am currently working on .Net 2.0. Please show me the way, Thanks,
You will have declare an event and raise it in the event which you want to capture e.g. if you have a button in your user control then you capture its click event as: 'Declare it in Declaration Section Public Event MyButtonClicked() 'In the click event of button you will have to write this: Private Sub cmdTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdTest.Click RaiseEvent MyButtonClicked() End Sub MyButtonClicked() event will be available in aspx form and you can handle it. hope you will get it if you face any problem let me know. take care Javed