Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using a MKB time selector here is the my aspx code.I want put a validation so that end time should not be less than the start time.Any help would be appreciated.

ASP.NET
<MKB:TimeSelector ID="TimeSelector2"  runat="server" SelectedTimeFormat="Twelve" 
             AmPm="PM" BorderColor="Silver" Date="" Hour="0" Minute="0" Second="0">
         <MKB:TimeSelector ID="TimeSelector1"  runat="server" Date="" Hour="0">
Posted
Updated 7-Aug-13 21:06pm
v2
Comments
[no name] 8-Aug-13 5:09am    
Are you able to get the values of the timers in the code behind?
Amit Karyekar 8-Aug-13 5:36am    
Yes i am able to get those values.
[no name] 8-Aug-13 6:36am    
Can you please show the values that you are getting in the code behind?

1 solution

HI,

Lets assume you are getting the values as 1. "03:15", 2. "04:20".

In the code behind get the two values and store them in 2 different integer variables like a=0315, b=0420.

Now you got the two values as the two integers and you can compare the values of your own in simple if(a>b) statement.

Put the restrictions and validation messages with in the conditional statements as you want.

Remember this is not the ultimate way of doing the task. You can do it in many more ways. This idea came to my mind instantly so I thought it might show you a way to approach.

Thanks
 
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