< ASP: textbox runat = " Server " ID = " Textbox1 " Maxlength = " 10 " > </ ASP: textbox > < ASP: imagebutton ID = " Imagebutton1 " Runat = " Server " Skinid = " Calendarimagebutton " Onclientclick = " Javascript: Return false; " /> < Ajaxtoolkit: calendarextender runat = " Server " Targetcontrolid = " Textbox1 " Cssclass = " Ajaxtoolkit-calendarextender " Format = " Mm/DD/YYYY " Popupbuttonid = " Imagebutton1 " ID = " Calendarextender1 " />
1. pages using the calendarextender control must include Ajax extensions Control scriptmanager ;
2. calendarextender properties Format customizable date display format. The default value is " d ", displayed as " 1/25/2007 ". if you want to customize the date format as " 2007-01-25 ", use the string " yyyy-mm-DD ", instead of " yyyy-mm-DD ";
3. as shown in, if you want to get the date value from the textbox control, ensure that textbox controls readonly the attribute value is" false ", if it is set to " true ", the textbox the value is obtained in the control.
4. Note:Targetcontrolid, popupbuttonidAttributes.