如何避免文本框中的0或o.oo? [英] How to avoid 0 or o.oo in textbox?

查看:67
本文介绍了如何避免文本框中的0或o.oo?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





如何在文本框中避免0或0.00(零或零.zerozero)当保存按钮?。这是金额列。它有小数点。有人告诉我Validation控件或any.Plz帮帮我。

Hi,

How to avoid 0 or 0.00(Zero or Zero.zerozero) in textbox When save button?.This is amount column.It has decimal plces. Anybody tell me Validation controls or any.Plz Help me .

推荐答案

如果您使用的是ASP.NET表单,可以使用比较验证器:

If you are using ASP.NET forms, you can use the compare validator:
<asp:TextBox id="txt1" runat="server" />
<asp:CompareValidator

  id="compval" 

  ControlToValidate="txt1"

  Type="Double" 

  Text="Validation Failed!" 

  Operator="GreaterThan"

  ValueToCompare = "0"

  runat="server" />







有充足的资源如果您谷歌搜索asp.net comparevalidator




There are plenty of resources if you google for "asp.net comparevalidator"


这篇关于如何避免文本框中的0或o.oo?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆