Responding to event from programmatically created button - ASP.NET

D

dinotius

Hi,

Can anyone please tell me how to respond to an event in VB when a
programmatically created button is clicked?
I can get it to work if the addhandler event is in the pages Page_Load
sub but not in a custom routine.

Thanks.
 
C

Cowboy \(Gregory A. Beamer\)

Make sure there is an event declaration in the conrol:
Public Event BubbleUpRegister As EventHandler(Of EventArgs)

Add handler:
Protected Sub RegisterUnit1_BubbleUpRegister(ByVal sender As Object, ByVal e
As System.EventArgs) Handles RegisterUnit1.BubbleUpRegister

If this does not work, the control is likely NOT declared using WithEvents.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top