You can use the My97 date picker component to collect date values entered by the user.
First download the component: Http://www.my97.net/dp/index.asp into your project.
Then reference the JS and CSS files inside the project, for example:
< script language = "JavaScript" type = "Text/javascript" src = "./my97datepicker/wdatepicker.js" ></ script > < link href = "./my97datepicker/skin/wdatepicker.css" rel = "Stylesheet" type = "Text/css" />
Of course, the directory should be written right.
Then add a text box to the page:
<class= "wdate" type= "text" onclick= " Wdatepicker () " ID=" Htmltxtbirthday " runat=" Server " readonly = "readonly"/>
You can use an ASP. NET TextBox or an HTML text box.
However, the default starting date for this component is the current date of the client. Sometimes you need to enter the data is a birthday, if the start date is the current date, it is necessary to click several times to find the appropriate date, a little trouble.
See the documentation on the official website and find a solution:
But from this point of view, it seems not flexible enough. For example, sometimes we expect users to be about 16 years old, so consider pushing forward 15 or 16 as the starting date with the current date.
<class= "wdate" type= "text" onclick= "Dt=new Date (); Y=dt.getfullyear () -15;dt2= y.tostring () + '-' + (Dt.getmonth () +1) + '-' +dt.getdate (); Wdatepicker ({startdate:dt2}) " ID=" Htmltxtbirthday " runat=" Server " readonly=" readonly "/>
The starting date for this place is 15 years ago today. However, if today is a leap year February 29, 15 years ago without February 29, it may be wrong. It is therefore possible to consider the starting date of New Year's Day, 15 years ago.
<class= "wdate" type= "text" onclick= "Dt=new Date (); Y=dt.getfullyear () -15;dt2= y.tostring () + '-' + 1 + '-' +1; Wdatepicker ({startdate:dt2}) " ID=" Htmltxtbirthday " runat=" Server " readonly=" readonly "/>
ASP. My97 Date Picker When you set the default start time to n years ago today