If you want to pass it as part of the URI itself, you need to consider the default routing defined in Global.asax. If you did not change it, it indicates that the URI breaks into / Controller / action / id.
For example, uri 'Home / Index / hello' translates to Index ("hello") in the HomeController class.
Therefore, in this case, it should work if you change the name of the DateTime parameter to "id" instead of "date".
It may also be safer to change the type of the parameter from 'DateTime' to 'DateTime?' to prevent mistakes. And as a second note, all controller methods in the mvc template must return an ActionResult object.
Good luck
source share