如何使 ASP.NET AJAX CalendarExtender 始终可见?
我希望能够在加载时显示 .NET AJAX CalendarExtender,而无需单击文本框。如果我可以模拟一个文本框被单击,那么 CalendarExtender 将显示我也会这样做。
I'd like to be able to have the .NET AJAX CalendarExtender show on Load without having to click in a TextBox. If I can simulate a TextBox being clicked so the CalendarExtender will show I'll take that too.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
CalendarExtender 不支持它。您可以自己编写,但使用标准 日历 控件(如果您想要始终可见的日历)。
当您希望日历根据需要弹出时,扩展器旨在与文本框一起使用。当基本控件已经存在时,为什么要编写新控件呢?
编辑
解决评论中关于需要轻松切换年份的观点。我完全理解。这对我来说也是一种挫败感。然而,有几种方法可以克服这个问题。可以在这里找到一个很好的例子: https://web.archive.org/web/20210304123649/https://www.4guysfromrolla.com/articles/090104-1.aspx
The CalendarExtender does not support it. You could write your own, but it would be much simpler to just use a standard Calendar control if you want a calendar that's always visible.
The extender was meant for use with a textbox when you want the calendar to pop up as needed. Why write a new control when the basic control already exists?
Edit
To address the point in the comment about needing to switch years easily. I COMPELTELY understand. This is a frustration for me as well. however, there are several ways to overcome this. One good example can be found here: https://web.archive.org/web/20210304123649/https://www.4guysfromrolla.com/articles/090104-1.aspx