Write below code:-
public bool IsNumeric(string Text)
{
System.Text.RegularExpressions.Regex regularExpression = new System.Text.RegularExpressions.Regex("^-[0-9]+$|^[0-]+$");
return regularExpression.Match(Text).Success;
}
if (IsNumeric("1"))
Response.Write("Yes it's Numeric");
else
Response.Write("No it's a String");
Response.Write("<br/>");
if (IsNumeric("baba"))
Response.Write("Yes it's Numeric");
else
Response.Write("No it's a String");
Response.Write("<br/>");
Yes it's Numeric
No it's a String