ControlCollection.Contains Method
.NET Framework 2.0
Determines whether the specified server control is in the parent server control's ControlCollection object.
Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
// Create an event handler that uses the
// ControlCollection.Contains method to verify
// the existence of a Radio3 server control in
// the ControlCollection of the myForm server control.
// When a user clicks the button associated
// with this event handler, Radio3 is removed
// from the collection.
void RemoveBtn_Click(Object sender, EventArgs e)
{
if (myForm.get_Controls().Contains(Radio3)) {
myForm.get_Controls().Remove(Radio3);
}
} //RemoveBtn_Click
Community Additions
ADD
Show: