Click here to Skip to main content
16,001,721 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
i have a sale page where the item and there rate is retrieved from database.
like when i wright a item code it retrieve the item name along with its rate on the text boxes.
now problem is that my user want to change the rate so retrieved from database.
suppose item name is Book and its rate is 100. user want to change the rate from 100 to 101 or 110 0r any value more than 100 or equal to 100.
so my question is this that how can he do it. suppose if he chose 100(which is automatic retrieved from database) or more than 100 he is allowed. and when he chooses or enter value less then 100 an error message get generated.
this will go like this when the value so retrieved from the database will be edited by user at the client side and this will get post back and this post back will do the comparison,if the value is less then the retrieved one then an error script will be displayed. and if the value is equal or more then it will continue the user to enter another credentials.
give me logic or code how to go for it.
i am using VS 2010 and SQL server 2008.
Posted
Updated 14-Jan-14 20:38pm
v2

Hello,

You can use "Rangevalidator" control in VS which will allow you to validation range and its an client side validation .But for Server side validation Javascript will require to validate the range.
 
Share this answer
 
Quote:
<asp:comparevalidator id="CompareValidator1" runat="server" xmlns:asp="#unknown">
ErrorMessage="*you should input value equal to or grater then old value" ControlToValidate="TextBox2" ControlToCompare="TextBox1" Operator="GreaterThanEqual" Type="Integer">
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900