473,772 Members | 3,731 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Creat eInstance(Syste m.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 "IncrementProce ss" 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 programatticall y, 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**********@au stin.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**********@au stin.rr.com

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

1. The fact that I am using Activator.Creat eInstance 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
12148
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 events since I never saw it used anywhere in MSDN documentation/samples?! Or it will just break when I upgrade to .NET Framework 2.x in the coming years namespace MyNamespac public delegate void MyDel() public class MyBase public virtual...
1
7587
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 dropdown in UC1 _________________________ 1) MainPage_Load 2) User Control_1 Load
1
8167
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 first time the control is dynamically loaded, everything works fine. After that, if the control is loaded again from the page button event handler, the user controls events fail to fire on the first click NOTE: I (believe I) am rebuilding all...
3
2303
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 WebApplication1 { using System;
1
1638
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 buttons i have added the handlers. Finally added the label and buttons to a place holder. When page is rendered i am able to see the label and buttons. but when i click the buttons events are not firing. i found two problems. First one is when i...
5
4396
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 my controls are created in CreateChildControls() for my custom control. Here's a snippet of code: DropDownList dd = new DropDownList(); dd.ID = "DropDown1"; if( !Page.IsPostBack )
9
2308
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 events a control is firing when I perform a certain action, and the order in which they are occurring. Thanks, Erik
5
1776
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 the aspnetdb database (which we have placed on a proper SQL Server, not SQL Server Express). Everything works like a charm, with the following exception: New users in the system have to press links or buttons twice upon their first logon to...
4
2054
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 status of the download changes. Some of the events are used to tell the next file to download while others manager other resources. However, on occasion, one event will
0
10261
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10104
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9912
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.