Click here to Skip to main content
12,454,477 members (56,370 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP.NET
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 .
Posted 21-Dec-12 5:33am
24983775
Updated 21-Dec-12 5:52am
v2
Comments
Akbar Ali Hussain 21-Dec-12 12:09pm
   
Is the TextBox in a DataGrid?
santhosh19783 22-Dec-12 11:43am
   
I want to only normal textbox

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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" />


There are plenty of resources if you google for "asp.net comparevalidator"
  Permalink  
Comments
santhosh19783 22-Dec-12 11:43am
   
Thanks Barrow
Keith Barrow 23-Dec-12 16:03pm
   
No problem.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160826.1 | Last Updated 21 Dec 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100