Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Proper way to reload CompositeControl when its state must change after Postback

Reply
Thread Tools

Proper way to reload CompositeControl when its state must change after Postback

 
 
jeljeljel
Guest
Posts: n/a
 
      09-20-2007
I am creating a CompositeControl that contains a Table. The rows in
the Table are controlled by an internal pager. The control renders
the pager and the table. When the user clicks the pager, the control
shows the next set of records in the table.

Assume after the OnLoad method the control has regenerated to the
exact state when the last time the page unloaded (with ViewState or
some other means -- important part is the control's state is the same
as when the page unloaded). Then the control changed events fire,
then the post back events fire. A post back event is received from
the Pager that the user requested a new page.


So now the CompositeControl must "tear down" the old markup and
regenerate the new markup.


Is this as simple as calling Controls.Clear()? There must be more to
it, b/c when I call Controls.Clear(), the Count becomes 0, and I
create the new markup (in CreateChildControls). The Count property
on
Controls.Count shows new controls have been added, but when the page
renders, the original markup is what displays.


Thanks,
John

 
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
Its a bird, its a plane, no ummm, its a Ruide thunk Ruby 1 03-30-2010 11:10 AM
Proper way to reload CompositeControl when its state must change after Postback jeljeljel ASP .Net Building Controls 1 09-20-2007 07:36 PM
Dropdown in webpart lost its state after postback Alex ASP .Net Web Controls 1 12-15-2006 03:57 PM
CustomControls inherented from CompositeControl allways have as tag span - how to change this Rolf Welskes ASP .Net 2 10-05-2006 12:56 PM
CompositeControl class failing to register postback Mantorok ASP .Net 2 06-22-2006 08:47 AM



Advertisments