How to clear list boxes in a content page. The content page is inside of a content place holder control
with the id="ContentPalceHolder1"
C#
' ---use this code for a content page webform
For Each ctrl In Me.Master.FindControl("ContentPlaceHolder1").Controls
If ctrl.GetType() Is GetType(TextBox) Then
CType(ctrl,
TextBox).Text = ""
End If
Next
C#
//---for a content page:
foreach (Control ctrl in
this.Master.FindControl("ContentPlaceHolder1").Controls)
{
if (ctrl is TextBox)
((TextBox)ctrl).Text = "";
}