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

后端 未结 1 1588
情深已故
情深已故 2021-01-25 14:36

Would like some help please:

Design First (Access Conversion) Composite Key is CalendarDate and Round.

From Index.cshtml


        @f         


        
相关标签:
1条回答
  • 2021-01-25 14:54

    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.

    0 讨论(0)
提交回复
热议问题