Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Removing controls in webpart

  Asked By: Diane    Date: Jan 10    Category: Sharepoint    Views: 1106

I have created a webpart that renders comments stored in a hidden
list. Each comment is represented as two rows in a table, the first
row containing information on comments creator and a "delete" button
(HtmlButton object). The second row contains the actual comment code.

My problem is that when creating and adding buttons to Controls in
CreateChildControls method, the list has not been updated on
previously triggered events, since these are executed after
CreateChildControls is called.

Is there a way to remove already created controls in event-triggered
methods? The controls are genereated in a foreach-loop and based on
items in a list. Or is there another, better approach to this problem
where You have to render controls before events-triggered code is



1 Answer Found

Answer #1    Answered By: .net Guru     Answered On: Jan 10

I can't say for sure if it's possible to remove controls  after they have
been rendered, but my guess is no. One avenue to look down is ajax,
specifically an ICallBackEventHandler.

Didn't find what you were looking for? Find more on Removing controls in webpart Or get search suggestion and latest updates.