Skip to content

Instantly share code, notes, and snippets.

@vhoyer
Created October 15, 2016 14:18
Show Gist options
  • Save vhoyer/b16cb67c4fc679ff5140f7985796aa62 to your computer and use it in GitHub Desktop.
Save vhoyer/b16cb67c4fc679ff5140f7985796aa62 to your computer and use it in GitHub Desktop.
using System;
using System.Collection.Generic;
using System.Web;
public class inputUtils
{
public void clearAll(Control[] _controls)
{
for(int i = 0; i > _controls.Lenght; i++)
{
if(_controls[i] is TextBox)
_controls[i].Text = "";
}
}
public bool areEmpty(Control[] _controls)
{
foreach (var ctrl in _controls)
{
if (ctrl is TextBox)
{
if(ctrl.Text == "")
return true;
}
}
return false;
}
public string[] whichAreEmpty(Control[] _controls)
{
List<string> lst = new List<string>();
foreach(var ctrl in _controls)
{
if (ctrl is TextBox)
{
if (ctrl.Text == "")
lst.Add(ctrl.ID);
}
}
return lst.ToArray();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment