This example shows you how to check given input contains only numbers (digits) or not using regular expression in asp.net and c#.
Regular expression string strRegexpNumber = @"^[0-9 ]*$";
Explain about Partial Class