如何在 WebDateChooser 中禁用未来日期
我在 .net 应用程序中使用 WebDateChooser...默认情况下,日期选择器显示当前日期,以便我们可以选择当前年份之前 10 年和当前年份之后 10 年的任何日期...但我不想显示WebDateChooser 中的未来日期。 是否有任何属性可以将 Maxdate 设置为当前日期
<igsch:WebDateChooser ID="WebDateChooser1" runat="server">
</igsch:WebDateChooser><br />
如果您有任何想法请帮助我
I am using WebDateChooser in my .net application...by default the Date Chooser shows Current date,so that we can choose any date 10 years before the Current year and 10 years after the Current year...but i dont want to show the future date in the WebDateChooser.
Is there any property to set the Maxdate as current date
<igsch:WebDateChooser ID="WebDateChooser1" runat="server">
</igsch:WebDateChooser><br />
Please help me if you have some idea
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 WebDateChooser.MaxDate 属性。
在代码中(我认为适合您的需求):
或者在源代码中(不是动态的,所以我只是添加以供参考):
更新:(响应@sona的第一条评论)
以下是来自的一些代码我的源文件动态地完成了 MaxDate 属性的设置。
我无法证明这是最好的方法,因为我对 ASP.NET 的了解非常有限。 虽然,它应该对你有用......
You can use the WebDateChooser.MaxDate Property.
In code (which I think suits your needs):
Or in the source (not dynamic so I just added for reference):
UPDATE: (In response to the first comment from @sona)
Here's some code from my source file that accomplishes the setting of the MaxDate property dynamically.
I can't attest to this being the best approach since my knowledge of asp.net is very limited. Although, it should work for you...