<asp:textbox class="Text"
onkeypress="if (event.keyCode < 48 || event.keyCode >57) event.returnValue = false;"
id="txtY_Revenue" style="TEXT-ALIGN: right" runat="server" Width="90%" MaxLength="12">
</asp:textbox>
或者:
if (Tbx_Edition.Text != "")
{
bool a1=true;
foreach(char c in Tbx_Edition.Text)
{
if(char.IsNumber(c))
{
continue;
}
else if(c=='.')
{
continue;
}
else
{
a1 = false;
break;
}
}
}