Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2006

Tip: Looking for answers? Try searching our database.

Responding to event from programmatically created button - ASP.NET

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dinotius@gmail.com - 30 Sep 2006 18:56 GMT
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.
Cowboy (Gregory A. Beamer) - 30 Sep 2006 21:04 GMT
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.

Signature

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

*************************************************
Think outside of the box!
*************************************************

> Hi,
>
[quoted text clipped - 4 lines]
>
> Thanks.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.