How to limit year in ajax calendar extender

一世执手 提交于 2019-12-10 19:25:23

问题


I have a Calendar Extender.

I want to show only current year in calendar.

User can not select 2010 as current year is 2011.

So how to do this ?


回答1:


Use the StartDate and EndDate properties to set a range of acceptable dates that you want to allow the user to select - you can set this in the markup as per krolik's answer, or in the code-behind so you can set it to the current year e.g.

CalendarExtender.StartDate = new DateTime(DateTime.Today.Year,1,1);
CalendarExtender.EndDate = new DateTime(DateTime.Today.Year,12,31);



回答2:


Use StartDate property of your extender. For example:

<ajax:CalendarExtender ID="Calendar" StartDate="1/1/2011" runat="server" ... /> 

StartDate - Indicates start date for range that available for selection.



来源:https://stackoverflow.com/questions/8589609/how-to-limit-year-in-ajax-calendar-extender

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!