This is borrowed from someone else to write the control, you use the time to write some details clearly, can be used directly.
Http://www.cnblogs.com/hzxcms/p/4014917.html
This is the address of the original Bo.
1, first in <form id= "Form1" runat= "Server" > Add such a bar:
<asp:scriptmanager id= "ScriptManager1" runat= "Server" ></asp:ScriptManager>
You can then add controls directly to the foreground.
<asp:updatepanel id= "UpdatePanel1" runat= "Server" > <ContentTemplate> <asp:textbox id= "Requesteddeliverydatetextbox" runat= "server" width= "/> <asp:imagebutton id=" ImageButton " Imageurl= "~/file/timg.jpg" alternatetext= "Calendar" onclick= "Imagebutton_click" causesvalidation= "false" height= "25px"/> <br/> <div id= "Calendar" class= "Calendar" visible= "false" runat= "Server" > <asp:calendar id= "Requesteddeliverydatecalendar" runat= "Server" onselectionchanged= " Requesteddeliverydatecalendar_selectionchanged "/> </div> </ContentTemplate>
</asp:UpdatePanel>
The place of the red area is the address of the Imagebuttton, which needs to be modified.
2, the background code is as follows
The date selection icon is clicked ///</summary> protected void Imagebutton_click (object sender, EventArgs EventArgs) { //control the display and hide of the calendar, click ImageButton to display calendar calendars . Visible =!calendar. Visible; } <summary>/// Select Date, trigger via AJAX/// </summary> protected void Requesteddeliverydatecalendar _selectionchanged (object sender, EventArgs EventArgs) { Requesteddeliverydatetextbox.text = RequestedDeliveryDateCalendar.SelectedDate.ToShortDateString (); Hide Calendar calendars . Visible = false; }
3, Requesteddeliverydatetextbox.text is the value of the selection date
. NET date control (full. NET)