Design First Datetime Key. My scaffolded controller is finding MM/dd/yyyy instead of dd/MM/yyyy

梦想的初衷 提交于 2019-12-02 04:21:10

Thanks to Yas Ikeda for the following: The problem is to do with '/' in the urls. On the Index View I have changed the link from:

@Html.ActionLink("Edit", "Edit", new { CalendarDate = item.CalendarDate.ToString("dd/MM/yyyy"), Round = item.Round })

to

<a asp-action="Edit" asp-route-CalendarDate="@item.CalendarDate.ToString("o")" asp-route-Round="@item.Round">Edit</a> 

This fixes the routing problem and the Edit now works ok.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!