473,385 Members | 1,470 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Responding to event from programmatically created button - ASP.NET

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.

Sep 30 '06 #1
1 1246
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!
*************************************************
<di******@gmail.comwrote in message
news:11*********************@m7g2000cwm.googlegrou ps.com...
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.

Sep 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Avinash P. | last post by:
Hi All, My mmc snapin application written in c# logs all its events in custom event source that we have created for this application. When any error occurs the application also displays a...
3
by: Clarence Gardner | last post by:
I'm seeing surprising behavior, consistent across Opera, Firefox, and IE. An event handler is changing the value of an element, and there is apparently no Change event being generated for the...
0
by: JustMeNeedingHelp | last post by:
I have created a new project VB windows application. I have a button and a list box object on the form. Created a button click event added a for next loop to add a number of lines to the listbox...
5
by: Carlo Marchesoni | last post by:
From an aspx page (A.aspx) I open another one (B.aspx - for table lookup). When the user selects an entry in B.aspx I would like to force a button's event in A.aspx to be fired. I guess the only...
8
by: Donald Xie | last post by:
Hi, I noticed an interesting effect when working with controls that are dynamically loaded. For instance, on a web form with a PlaceHolder control named ImageHolder, I dynamically add an image...
6
by: WebMatrix | last post by:
Hello, Here's the situation (I'll try to be brief as possible) I am working on the control which is created dynamically based on XML string. This control consists of a table with number of rows...
2
by: Tim_Mac | last post by:
hi, i have an aspx page which dynamically loads a user control and adds it to a placeholder. the control is recreated and added to the placeholder for postbacks as well. the user control...
15
by: Oleg Subachev | last post by:
I need to programmatically invoke from other class Click event of the Button on my Form. Button.OnClick method is protected, not public. How to perform this ? Oleg Subachev
4
by: Bob | last post by:
Hi, I'm working with VWD and i defined programmatically a button (in code-behind) with an ID. So I expect to see beside "Page Events" and "Form1" my button "b1" in order to use the Click event....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.