ASP.NET MVC 日历设计
我想在 asp.net mvc 中设计一个日历,我想将月份信息作为地址栏中的字符串。我应该怎么办?之后我必须从index.aspx 显示本月。我该怎么做?
I want to design a calendar in asp.net mvc and I want to take month information as a string in address bar. What should I do? And after that I have to show this month from index.aspx. How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有点不清楚你想做什么。如果您尝试呈现一个日历以便用户可以输入日期,我会使用 jQueryUI 的 datepicker。默认样式看起来非常漂亮,使用简单,而且效果非常好。
重新阅读您的问题后,您似乎希望您的网址采用某种日期格式。如果是这种情况,您需要一个自定义路由,例如 this 中的路由文章。创建自定义路线后,打印日期相当简单:将日期的月份部分从控制器传递到视图并显示它。
It's a little unclear what you're trying to do. If you're trying to present a calendar so that a user can input a date, I'd use jQueryUI's datepicker. The default style looks pretty nice, it's simple to use, and it works really well.
After re-reading your question, it seems you want your URL to be in some sort of date format. If this is the case, you need a custom route, like the one in this article. After you have created your custom route, printing the date is rather simple: pass the month part of the date from your controller down to your view and display it.