Responding to event from programmatically created button - ASP.NET

  • Thread starter Thread starter dinotius
  • Start date Start date
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.
 
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.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************************************************
Think outside of the box!
*************************************************
 
Back
Top