mvc时间控件定在当前日期
设置 (The Setup)
If you do not understand what I mean by unintuitive, try creating the following MVC web application or skip to The Problem section below
如果您不理解直觉的意思,请尝试创建以下MVC Web应用程序,或跳至下面的“问题”部分
1) Start a new project ASP.NET Web Application in Visual Studio
1)在Visual Studio中启动一个新项目ASP.NET Web应用程序
2) Set MVC as the template type
2)将MVC设置为模板类型
3) Add an Entity Framework Model of a SQL database. For this article, it is a simple table that contains a few columns including a Date, DateTime and Time. You can generate the database from the Project files linked at the end of the article.
3)添加一个SQL数据库的实体框架模型。 对于本文来说,它是一个简单的表,其中包含几列,包括Date , DateTime和Time 。 您可以从本文结尾处的链接的Project文件生成数据库。
4) Scaffold a Controller and Views from this Model
4)搭建控制器并根据此模型进行视图