Tuesday, April 14, 2009

Prevent the User from selecting a Date Earlier than today

In this article i am using Calender extender to solve my problem easily..

I wil explain you step by step

step1:
open visual studio>click on File >New Website> choose your programming language (c# or vb)> Name the website>Choose your location..

step2:
Drag and drop the scriptmanger in your page..
the page looks like this



Step3:
Drag and drop the standard TextBox and Calender Extender.. Configure the calender Extender by giving the TargetControlID="TextBox1" and set OnClientDateSelectionChanged="checkdate".. we are using OnClientDateSelectionChanged to write the javascript to prevent the user from selecting a date earlier than today..

the page looks like this..




step5:
Now lets write the javascript






I hope you people like this application.Its easy to implement and very useful..

No comments:

Post a Comment