Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > order of events - dynamic checkbox events

Reply
Thread Tools

order of events - dynamic checkbox events

 
 
=?Utf-8?B?bG91aXNlIHJhaXNiZWNr?=
Guest
Posts: n/a
 
      08-17-2005
Hi there,

I am databinding a datagrid on the onload with the usual !IsPostBack
condition.

I have to create some dynamic checkboxes, because i dont know how many i
will need until the dataset comes back. take it as red that writing them into
the aspx is not an option.

So on the databind function of my grid I am doing the following:

CheckBox cb = new CheckBox();
cb.AutoPostBack=true;
cb.CheckedChanged += new System.EventHandler(cbPersonSelect_CheckChanged);

Once the page has loaded, hitting the checkbox just causes a postback and
nothing else. It is not raising the event. I know it is referencing the
correct function because if i change the above to
cb.CheckedChanged += new
System.EventHandler(cbPersonSelectBLAHBLAH_CheckCh anged);

It says my page definition doesnt contain cbPersonSelectBLAHBLAh etc..

I know it has something to do with the Page_Init which instanstiates all
server control events or something like that but I've tried some different
ways (putting the databind in the Page_Init etc) and it never raises the
event. Does anyone have a work around or can tell me what i'm doing wrong?
All i want to do is tell the checkbox to raise an event it cant be that hard
! Thanks.


cell.Controls.Add(cb);

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Events Events Events Please Help Chris ASP .Net Web Controls 0 08-30-2005 08:21 PM
Order of events problem with dynamic checkbox. Please help! =?Utf-8?B?bG91aXNlIHJhaXNiZWNr?= ASP .Net 0 08-17-2005 05:15 PM
A nested dynamic checkbox inside my dynamic form. pizzy Javascript 5 04-12-2005 02:55 PM
Need help with order of page events and adding dynamic button controls. seanmayhew@gmail.com ASP .Net 1 04-10-2005 06:29 PM
How to have a nested dynamic checkbox inside my dynamic form. pizzy Javascript 0 03-23-2005 03:32 AM



Advertisments