PDA

View Full Version : [CLOSED] Remove panel



tactime10
Nov 07, 2012, 12:20 PM
Hi,

I need to remove one panel added dynamically to another panel, I tried in this way but it doesn't work.



FormPanel formPanel = (FormPanel) this.panelContentLevels.FindControl("formPanelLevel");
if (formPanel != null) {
formPanel.Remove(formPanel);
}

Can you suggest me another way?
thank you so much.

Daniil
Nov 07, 2012, 1:20 PM
Hi @tactime,

Do you recreate this Panel each request? If no, a FindControl can't find it.

There is an overloaded Remove method which takes an id. I would recommend you to use this method.

tactime10
Nov 09, 2012, 4:35 PM
Hi,

you suggest me to call Remove method on the formPanel or to call on the panelContent?

Thank you

Daniil
Nov 12, 2012, 7:18 AM
It should be called for a Panel which you need to remove.