473,237 Members | 1,365 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,237 software developers and data experts.

Events not firing from dynamically instantiated classes.

Ok, this is going to be a long post, so I apologize in advance, but if
it was an easy question I would have probably found an answer somewhere
out here by now...

The short story of this is that I am creating a "process framework"
that allows for common web controls to be linked together in a
procedural fashion, and will also allow for code to be added to these
controls (IE New button events, etc). I have basically created a static
"conductor" class that reads in the class name for each the steps of
the process from the database, and then stores those objects in a
private hashtable member (thus making the steps static as well). Heres
a more detailed list of what happens:

1. The Step ID's are read in from the database, and the classes of each
step are instantiated ( using Activator.CreateInstance(System.Type,
string[]) ).
2. The Initialize method of the steps are called when they are each
instantiated.
( Note: The ProcessStep class actually implements a placeholder)
3. The conductor class then executes the current step in the process by
calling it's execute method, then it casts the ProcessStep to a
placeholder and puts it onto the page.
4. The ProcessStep's control collection has a button that implements
the "IncrementProcess" event handler that actually increments the step,
so that after a postback, if the process has been incremented, it calls
the execute method of the next step, otherwise executes the "current"
step, and casts it to a placeholder, putting it onto the page,
basically doing this till the process is complete.

So as you can see, this is a loose framework that allows for people to
code up webpages, and then link them together to get something more
complicated than a single page can accomplish.

Ok, so for the problem, again I have a (static) collection of
placeholders, which contain buttons. The placeholders are instantiated
dynamically (thus the buttons are instantiated dynamically in a way as
well, I mean, the buttons are all created programattically, no
designer), and for some reason, the buttons events are not firing... I
am at a total loss on this one.

I don't know how to explain it any clearer, I have some detailed
documentation on how the process framework works, but I can't post
attachments here, and it is a few pages long.

I have the complete code base available if anyone wants to look it over
(email me at mu**********@austin.rr.com). This code is a different
version from what is available at
http://www.codeproject.com/aspnet/RapidWebAppDev.asp
they just haven't updated to my latest code that I emailed them the
other day. But that article basically explains what I am doing.

Please, someone help, I am going crazy over this! This is for an
opensource project so you can chalk it up on your karma board if it
requires for ya to load up the code and look it over ;)

Andy Baldwin
mu**********@austin.rr.com

Nov 19 '05 #1
1 1473
Some additional information that I found out last night includes:

1. The fact that I am using Activator.CreateInstance doesn't have
amything to do with it.
2. NONE of the events are firing from the placeholders buttons.
3. Even casting the step to a placeholder in the codebehind file
doesn't work (it is currently being cast in a ProcessViewer control).

Please let me know if you guys have any ideas...

AB

Nov 19 '05 #2

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

Similar topics

14
by: JPRoot | last post by:
Hi I use the following syntax to have events inherited from base to child classes which works nicely (virtual and override keyword on events). But I am wondering if it is a "supported" way of using...
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
1
by: Earl Teigrob | last post by:
PROBLEM: When a user control is loaded into a PlaceHolder control more than once, the events do not fire on the first click of a control on the dynamically loaded user control. In other words, the...
3
by: Mike | last post by:
Hi, I am adding controls dynamically in a WebForm, but none of these controls' events fire. Here is the class code I am using. I have tried so many things, but nothing works :-( namespace...
1
by: Bob | last post by:
I have a requirement to show a label and x number of buttons in all of the pages. So i decided to write a Base Page class and added code for dynamically adding the label and buttons. For the...
5
by: bryanp10 | last post by:
I have a page that is almost entirely dynamically created. Textboxes and checkbox are working fine, firing events, and persistent their state. DropDownList is giving me a major headache. All...
9
by: Erik Frey | last post by:
Hi there, Just curious as to whether there's a clever way to see the events a control/object is firing off, perhaps written out to the debug console. It would be really handy to know which...
5
by: Paal Berggreen | last post by:
I am involved with development of a Portal solution using ASP.NET 2.0 and WebParts. The WebParts framework use the default personalization providers, and the personalization data thus ends up in...
4
by: jehugaleahsa | last post by:
Hello: Is there a way to prevent one event from firing while another event is already being fired? I have a tool that extracts media from web pages and it has multiple events firing when the...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.