I have renderad a CRUD with .net and have the following files in the same folder.
Create.cshtml, Delete.cshtml, Details.cshtml, Edit.cshtml, Index.cshtml
Now it is a link to create a new record on the index page
@Html.ActionLink("Create New", "Create")
But I want the create form to be on the index page.
I tested to use PartialView (I do not know whether it is better to copy the code from create.cshtml in index.cshtml or to use two files but I get the same error).
return in the controller to
And the view to
But I get the compiling error
The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[Klotterplank.Models.Board]', but this dictionary requires a model item of type 'Klotterplank.Models.Board'.
This is the model I use in index.cshtml
And this is the model I use in create.cshtml