zoukankan      html  css  js  c++  java
  • 验证TextBox只输入数字

    <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;
                    }
                }

    }

  • 相关阅读:
    Java之lambda表达式
    修改IntelliJ IDEA的java编译版本
    no route to host解决方案、Failed to start LSB: Bring up/down networking的问题解决方案
    spark转换集合为RDD
    spark编写word count
    nexus
    spark 源码安装
    spark shell
    maven
    git
  • 原文地址:https://www.cnblogs.com/hyd309/p/1282689.html
Copyright © 2011-2022 走看看