The regex pattern you need to use would be "^\d+(\.\d+)?$" (without the quotes) as the previously suggested ones wouldn't account for the decimal point. You could use it in the following ways:
Using a RegularExpressionValidator Control:
<pre lang="xml"><%@ language="C#" %>
<form id="form1" runat="server">
<asp:TextBox ID="textBox1" runat="server"/>
<asp:Button ID="btnSubmit" runat="server" Text="Submit" />
<asp:RegularExpressionValidator ID="regexpName" runat="server"
ErrorMessage="This is not a valid number."
ControlToValidate="textBox1"
ValidationExpression=@"^\d+(\.\d+)?$"/>
</form>
Or using the Regex class:
if(System.Text.RegularExpressions.Regex.IsMatch(textBox1.Text, @"^\d+(\.\d+)?$"))
{
doSomething();
}