Friday, February 6, 2009

How can I start using ajax calendar?

Calendar is an ASP.NET AJAX extender that can be attached to any ASP.NET TextBox control. It provides client-side date-picking functionality with customizable date format and UI in a popup control. You can interact with the calendar by clicking on a day to set the date, or the "Today" link to set the current date.
In addition, the left and right arrows can be used to move forward or back a month. By clicking on the title of the calendar you can change the view from Days in the current month, to Months in the current year. Another click will switch to Years in the current Decade. This action allows you to easily jump to dates in the past or the future from within the calendar control.
The page uses the culture setting Türkçe (Türkiye) which was specified by the browser. The page properties have Culture="auto" and UICulture="auto" set to enable the same. See this MSDN article for more information. The ScriptManager on this Calendar demo page has EnableScriptGlobalization="true" and EnableScriptLocalization="true".



  • Calendar Properties
    The calendar associated with a button has been initialized with this code. The properties in italic are optional:
    TargetControlID - The ID of the TextBox to extend with the calendar.
    CssClass - Name of the CSS class used to style the calendar. See the Calendar Theming section for more information.
    Format - Format string used to display the selected date.
    PopupButtonID - The ID of a control to show the calendar popup when clicked. If this value is not set, the calendar will pop up when the textbox receives focus.
    PopupPosition - Indicates where the calendar popup should appear at the BottomLeft(default), BottomRight, TopLeft, TopRight, Left or Right of the TextBox.
    SelectedDate - Indicates the date the Calendar extender is initialized with.

Sample Code:










ForeColor="#666666">İlk Tarih
ID="ImgBntCalc2" runat="server" CausesValidation="False" ImageUrl="~/images/Calendar_scheduleHS.png" />ID="MaskedEditExtender51" runat="server" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder=""
CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder=""
CultureTimePlaceholder="" Enabled="True" ErrorTooltipEnabled="True" Mask="99/99/9999"
MaskType="Date" TargetControlID="frm_DateAra">

ControlToValidate="frm_DateAra" Display="Dynamic" EmptyValueBlurredText="*" EmptyValueMessage="Date is required"
ErrorMessage="MaskedEditValidator51" Font-Size="11px" InvalidValueBlurredMessage="*"
InvalidValueMessage="Geçersiz Tarih" TooltipMessage="Tarih Arama" ValidationGroup="MKE3">
ID="CalendarExtender51" runat="server" Enabled="True" PopupButtonID="ImgBntCalc2"
TargetControlID="frm_DateAra">






No comments: