Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Dynamic Controls

Reply
Thread Tools

Dynamic Controls

 
 
Jim Heavey
Guest
Posts: n/a
 
      05-11-2004
Hello, I have a web page with a <ASP:Table> control on the form. This
table also has 5 DataListControls on 5 seperate <ASP:TableRow> controls.

In code I am dynamically adding TableRow controls to this Table control.
Depending on the content of the DataRows being added, I will set the
appropriate DataListControls to be visible and set the DataSource.

When The page is displayed on the Form Load, all is well, but when I hit
the "Edit" button on one of the DataListControls, the page re-displays
without running the the "OnItemCommand" event and that control show up as
an empty row on my grid.

I thought that since the DataListControls were on the form (maybe not in
the correct poistion, but they were on the form), that the system would
maintain state. I know that if I were to do a Page.Bind in the FormLoad
method on the postback, that this would probably kill the event, and I have
look closely and I have done no rebinding of any control, all I have done
is place the "missing, but expected to be missing, Table Rows back into the
Table control.

SO I must have a hole in mu understanding of dynamic controls.

Can someone clear up my misunderstanding???

Your assistance is greatly appreciated!!!!
 
Reply With Quote
 
 
 
 
Natty Gur
Guest
Posts: n/a
 
      05-12-2004
Hi,

Dynamic create control should be create every time your page create.
Usually creation of dynamic control happened in Form_load event. Load
event called every time page request and it also the last place on the
page life cycle where you can add event handlers to your dynamic
controls. ViewState maintain data for controls and not maintain
controls.

HTH

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
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
Dynamic Wizard with Dynamic Validation Controls =?Utf-8?B?U3RldmUgRnVuaw==?= ASP .Net 0 10-13-2006 05:40 PM
Dynamic Controls created by Dynamic Controls Ronald ASP .Net 2 01-17-2006 12:44 AM
Dynamic Events from Dynamic Controls on a User Control - Guess What? Broken! mytestemailaccount@gmail.com ASP .Net 5 03-23-2005 05:06 PM
Dynamic Variables? OR Dynamic Controls =?Utf-8?B?VGVyb3M=?= ASP .Net 1 08-10-2004 01:13 PM
Dynamic Controls, Placeholder, Retrieve Information from Dynamic Controls Denny Smolinski via .NET 247 ASP .Net Web Controls 1 05-04-2004 09:15 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57