reference:
            ushort iTotal =0;
            System.Web.UI.WebControls.TextBox wCtrl ;
            foreach (Control ctrl in Page.Controls)
            {                if(ctrl.GetType().ToString().Equals("System.Web.UI.HtmlControls.HtmlForm"))
                {
                    foreach(Control tCtrl in ctrl.Controls )
                    {
                        if (tCtrl.GetType().ToString().Equals("System.Web.UI.WebControls.TextBox"))
                        {
                            wCtrl = (System.Web.UI.WebControls.TextBox)tCtrl;
                            try 
                            {iTotal += IsNumeric(wCtrl.Text) ? Convert.ToUInt16(wCtrl.Text) : Convert.ToUInt16(0);
                            }
                            catch 
                            {
                                iTotal = 0;
                                litError.Text = "<BR><FONT color=red size=+1>ERROR: Values too large. Please modify and try again</FONT><BR>";
                                break;
                            }                            
                        }
                    }
                }
            }
            litSum.Text  = iTotal.ToString();