1
Reply

how to validate Numeric value in all TextBox(s) in ASP Panel controller ?

subhank P

subhank P

11y
826
0
Reply

     private bool CheckZeroValue(Panel Container1)
            {
                foreach (Control control in Container1.Controls)
                {
                    if (control is TextBox)
                    {
                        TextBox textBox = (control as TextBox);
                        if (string.IsNullOrEmpty(textBox.Text.Trim()))
                        {
                            throw new Exception("Either Null or Empty !");
                            textBox.Focus();
                            return false;
                        }
                    }
                }
                return true;