i want to use two textboxes to get value from user as minimum price and maximum price..i want to validate that the second value must be greater than the first value..how is this possible??
ErrorMessage="Values should be within the range..."
Operator="LessThanEqual"
Type="Integer"
>*</asp:CompareValidator>
Something like above....
validation
I blog at http://rajeshpillai.net and have a community startup http://ownabook.org/
(Don't forget to click "Mark as Answer" on the post(s) that helped you.)
Marked as answer by aabhatt on Mar 16, 2012 10:40 AM
aabhatt
Member
114 Points
87 Posts
how to validate two price textboxes??
Mar 16, 2012 10:27 AM|LINK
hi all!!
i want to use two textboxes to get value from user as minimum price and maximum price..i want to validate that the second value must be greater than the first value..how is this possible??
karthicks
All-Star
31382 Points
5424 Posts
Re: how to validate two price textboxes??
Mar 16, 2012 10:30 AM|LINK
Use asp.net CompareValidator
Refer : http://asp.net-tutorials.com/validation/compare-validator/
http://www.w3schools.com/aspnet/control_comparevalidator.asp
http://msdn.microsoft.com/en-us/library/db330ayw(v=vs.71).aspx
to Set Range use RangeValidator
Refer : http://asp.net-tutorials.com/validation/range-validator/
http://www.w3schools.com/aspnet/control_rangevalidator.asp
http://msdn.microsoft.com/en-us/library/f70d09xt(v=vs.71).aspx
Karthick S
Usha82
Member
710 Points
129 Posts
Re: how to validate two price textboxes??
Mar 16, 2012 10:30 AM|LINK
You can use a custom validator for it and on submitting the page you can validate it.
kedarrkulkar...
All-Star
34535 Points
5554 Posts
Re: how to validate two price textboxes??
Mar 16, 2012 10:30 AM|LINK
u should use comparevalidator control
here is exactly what u looking for
http://asp.net-tutorials.com/validation/compare-validator/
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site
aabhatt
Member
114 Points
87 Posts
Re: how to validate two price textboxes??
Mar 16, 2012 10:31 AM|LINK
how to set the ranges for two textboxes??is it possible to bind the two textbox values
thinkrajesh
Participant
1356 Points
232 Posts
Re: how to validate two price textboxes??
Mar 16, 2012 10:33 AM|LINK
You can use the compare validator for this...
An example is shown here..
http://www.vkinfotek.com/aspnetvalidationcontrols.html
An example might be....
<asp:CompareValidator ID="ComparePrice" runat="server"
ControlToCompare="textbox1"
ControlToValidate="textbox2" Display="Dynamic"
ErrorMessage="Values should be within the range..."
Operator="LessThanEqual"
Type="Integer"
>*</asp:CompareValidator>
Something like above....
validation
(Don't forget to click "Mark as Answer" on the post(s) that helped you.)
nrk_hi
Member
136 Points
110 Posts
Re: how to validate two price textboxes??
Mar 16, 2012 10:43 AM|LINK
try like this:-
checkout this link where tutorials is also available :- http://code4world.blogspot.in/2012/03/validation-comparevalidator-aspnet.html