我想要一个日期选择器代码。 我想要的是我只选择与星期一相关的日期。用户无法选择星期一以外的日期。 选择星期一日期后,还有其他6个文本框需要自动填写。 Ex。 17-11-2014(dd-mm-yyyy)由用户选择。 下一个文本框需要填写,如18,19,20 ... 2014年11月22日 如果您需要更多详细信息,请联系我。 onlybigb321@gmail 谢谢
解决方案如果你想用ASP.NET做(服务器端)代码然后您可能想要查看DateTime实例的DateTime.DayOfWeek属性。 您要做的是发送用户选择的DateTime,在服务器端,检查该DateTime的日期为 if (dateTime1.DayOfWeek == DayOfWeek.Monday){ // 是的dateTime是星期一 } else { // 不,他选择任何其他日子 }
然后,您可以根据此数据填充剩余的控件。有关 MSDN上的DateTime.DayOfWeek 的更多信息[ ^ ]。
I want a date picker code. What I want is that only dates related to Monday should me selected. A user cannot select dates other than Monday. After the selection of Monday date there are other 6 textboxes that needs to be filled up auto. Ex. 17-11-2014 (dd-mm-yyyy)is selected by the user. The next text boxes need to be filled up like 18,19,20...22-11-2014 If you require more detail please contact me. onlybigb321@gmail Thanks
解决方案 If you want to do it using ASP.NET (server-side) code then you might want to look at the DateTime.DayOfWeek property of the DateTime instance. What you would do, is to send the DateTime that the user selected, and on the server side, check the Day for that DateTime as if(dateTime1.DayOfWeek == DayOfWeek.Monday) { // yes the dateTime is monday } else { // no, he selected any other day }You can then fill the remaining Controls by the data depending on this. More on DateTime.DayOfWeek here on MSDN[^].
更多推荐
Asp.Net中的日期操作
发布评论