473,408 Members | 2,888 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,408 software developers and data experts.

rebinding event handlers, how?

Hi
I'm creating controls programatically. On postback, the events of the
controls are not triggered correctly. I need to not only rebind the
controls to their datasource on every load, but reassign the event
handlers.

but how?

I should do this in the Page's Init event handler rather than in the
Page_Load
event handler right?

help me please, I'm stuck

Jul 13 '06 #1
3 1458
Init would be a far better choice than Load since a lot can happen between
Init and Load. If you assign your event handlers in the init event it should
fire properly. If that is not working could you provide us with more detail?

--
-Demetri
"la********@gmail.com" wrote:
Hi
I'm creating controls programatically. On postback, the events of the
controls are not triggered correctly. I need to not only rebind the
controls to their datasource on every load, but reassign the event
handlers.

but how?

I should do this in the Page's Init event handler rather than in the
Page_Load
event handler right?

help me please, I'm stuck

Jul 13 '06 #2
I don't know how to assign event handlers programatically to an object
yet, how do yo do it?
more especifically, a buttoncolumn in a datagrid.
Demetri wrote:
Init would be a far better choice than Load since a lot can happen between
Init and Load. If you assign your event handlers in the init event it should
fire properly. If that is not working could you provide us with more detail?

--
-Demetri
"la********@gmail.com" wrote:
Hi
I'm creating controls programatically. On postback, the events of the
controls are not triggered correctly. I need to not only rebind the
controls to their datasource on every load, but reassign the event
handlers.

but how?

I should do this in the Page's Init event handler rather than in the
Page_Load
event handler right?

help me please, I'm stuck
Jul 13 '06 #3
myButton.Click += new EventHandler(myButton_Click);

Where myButton_Click is the method that will handle the event.

--
-Demetri
"la********@gmail.com" wrote:
I don't know how to assign event handlers programatically to an object
yet, how do yo do it?
more especifically, a buttoncolumn in a datagrid.
Demetri wrote:
Init would be a far better choice than Load since a lot can happen between
Init and Load. If you assign your event handlers in the init event it should
fire properly. If that is not working could you provide us with more detail?

--
-Demetri
"la********@gmail.com" wrote:
Hi
I'm creating controls programatically. On postback, the events of the
controls are not triggered correctly. I need to not only rebind the
controls to their datasource on every load, but reassign the event
handlers.
>
but how?
>
I should do this in the Page's Init event handler rather than in the
Page_Load
event handler right?
>
help me please, I'm stuck
>
>

Jul 13 '06 #4

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

Similar topics

10
by: tony kulik | last post by:
This code works fine in ie and opera but not at all in Mozilla. Anybody got a clue as to how to get it right? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <script...
8
by: Dennis C. Drumm | last post by:
I have a class derived from a SortedList called SystemList that contains a list of objects indexed with a string value. The definition of the objects contained in the SortedList have a boolean...
18
by: bhavin | last post by:
Hi, Can someone point me to some good best practices kind of documentation on use of events compared to method overriding. Ex. In Windows Forms when should i have an event handler for Paint, and...
13
by: Charles Law | last post by:
Mr "yEaH rIgHt" posted the following link about a week ago in answer to my question about removing event handlers. > http://www.vbinfozine.com/t_bindevt.shtml Following on from that post, the...
5
by: Amit | last post by:
Hello! Is it possible to find how many event handlers an event has at runtime? How about finding whether or not an event has event handlers? In C# you can compare the event with null to check if...
6
by: Kevin Attard | last post by:
I am using a GridView inside a UserControl which has a template column for deleting the rows. Before databinding the gridview i am attaching the RowCommand and RowDataBound event. I am using the...
16
by: Hamed | last post by:
Hello I am developing a utility to be reused in other programs. It I have an object of type Control (a TextBox, ComboBox, etc.) that other programmers use it in applications. they may set some...
14
by: Hamed | last post by:
Hello It seems that I should implement ICloneable to implement my own clone object. the critical point for me is to make a control object based on another control object that all of its event...
6
by: Tony Johansson | last post by:
Hello! I know it's possible to have several event handler for a single event but I can't see any point using several event handler for this. I'm probably wrong so can anybody tell me what...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.