29 January 2015

Decimal number validation in c#.net

           decimal d;
            if (decimal.TryParse(txt_number.Text, out d))
            {
                //valid Number
                // Do something with value
            }
            else
            {
                //invalid Number
                                lbl_error.Text = "Please enter a valid number";
                return;
            }

No comments:

Post a Comment