. NET date control (full. NET)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.