在ASP.Net MVC Razor中,我需要提供一个带有两个选项的单选按钮控件。一个选项是静态的,第二个选项是获取日期的Calendar控件。如何实现这一目标。
发布于 2022-05-23 10:04:38
1.使用jquery选择器从calander.中挑选日期
链接:
<link rel="stylesheet" href="//code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>html:
<input type="text" id="datepicker"></p>2.@html.TextBoxFor(x=>x.DateParameter) 用于手动插入.
格式应该类似于1990-06-20 08:03
另外,您可以采用日期和时间的字符串格式,然后使用DateTime.Parse()将其转换为控制器中的DateTime.Parse()格式。
https://stackoverflow.com/questions/72061952
复制相似问题