Created
October 15, 2016 14:18
-
-
Save vhoyer/b16cb67c4fc679ff5140f7985796aa62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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