Use of the calendar control in Ajax

Source: Internet
Author: User

First, the control code is configured on the page.

View Code

1 Code
2 Language = "C #" AutoEventWireup = "true" CodeFile = "Default. aspx. cs" Inherits = "_ Default" %>
3 <% @ Register assembly = "AjaxControlToolkit" namespace = "AjaxControlToolkit" tagprefix = "PC3" %>
4 <! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5 6 7 <title> No title page </title>
8 9 <body>
10 <form id = "form1" runat = "server">
11 <asp: ScriptManager ID = "ScriptManager1" runat = "server" EnableScriptGlobalization = "true">
12 </asp: ScriptManager>
13 <div>
14 </div>
15 <PC3: CalendarExtender ID = "CalendarExtender1" runat = "server"
16 TargetControlID = "TextBox1">
17 </PC3: CalendarExtender>
18 <asp: TextBox ID = "TextBox1" runat = "server"> </asp: TextBox>
19 </form>
20 </body>
21

Then, we need to add a style.

View Code

 1 <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %><asp:scriptmanager ID="Scriptmanager1" runat="server"></asp:scriptmanager>
2 <asp:TextBox ID="SearchText" Width="150px" runat="server" />
3 <input type ="button" id ="show" />
4
5 <ajaxToolkit:CalendarExtender TargetControlID ="SearchText" CssClass="MyCalendar"
6 runat ="server" PopupButtonID="show" ID ="Calendar" Animated="true"
7 Format="yyyy-MM-dd" Enabled="true"></ajaxToolkit:CalendarExtender>
8
9 <ajaxToolkit:AutoCompleteExtender runat="server" ID="AutoCompleteSearch"
10 MinimumPrefixLength="1" TargetControlID="SearchText"
11 ServicePath="AutoCompleteService.asmx"
12 ServiceMethod="GetSearchTerms"></ajaxToolkit:AutoCompleteExtender>
Related Article

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.