Time Validation
i am using mask edit extender for time field textboxes .for that ,my scenario is start time should be less than end time .give me some validation expression or customvalidation samples
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Josip JuricPosted Dec 7, 2010, 11:12 AM
TimeSpan tsStart;
TimeSpan tsEnd;
//tsStart you get parsing from masked textBox
tsStart= TimeSpan.Parse(maskedTextBox1.Text);
//tsEnd is time what you choose
tsEnd = new TimeSpan(20, 50, 30);
//Then using usual if statement you can check is tsStart smaller or bigger than tsEnd
if (tsStart < tsEnd)
{
}
If something isn't clear just say.