如何限制今年阿贾克斯日历扩展 [英] How to limit year in ajax calendar extender

查看:78
本文介绍了如何限制今年阿贾克斯日历扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个日历扩展。

我要显示在日历中目前唯一的一年。

I want to show only current year in calendar.

用户不能选择2010作为本年度为2011。

User can not select 2010 as current year is 2011.

那么,如何做到这一点?

So how to do this ?

推荐答案

使用了开始日期结束日期属性设定一个范围,要允许用户选择可接受的日期 - 你可以设置在标记按照 krolik的答案,或在code-背后,所以你可以将其设置为当前年份,例如

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);

这篇关于如何限制今年阿贾克斯日历扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆