What i’m trying to do is basically create one way to verify that all textboxes are full. So if i Have 11 textboxes on one page I can basically run this QC check and verify each textbox ha some information.
this is what I’m trying to do but it’s not working out.
private void VerifyTextBoxes()
{
Control[] AllTextBoxes = FindControl("TextBox");
foreach(Control c in AllTextBoxes)
{
//verify work here
}
}
The problem is two fold, I know that FindControl is not converted into an [], but i’m not sure how to do that. Also, the FindControl is looking for an ID name, is there a way to find it by type? For example all TextBoxes? Or all ComboBoxes?
Here is my aspx
<asp:Content ID="Content1" ContentPlaceHolderID="AdministrationContent" runat="Server">
<ul>
<li>
<asp:Label ID="DealerShipID" runat="server" Text="Dealership ID"></asp:Label>
</li>
<li>
<telerik:RadTextBox ID="InputDealershipID" runat="server" Width="250px">
</telerik:RadTextBox>
</li>
</ul>
You could loop through all controls and pull out only the TextBoxes: