0
Good morning, I have an Edit Timetable page, which works perfectly, but on this Edit page, I need to call the Horario Item Index page, I’m trying this way on the EDIT page :
<div class="row">
<div class="col-md-offset-2 col-md-10" id="replacetarget">
@await Component.InvokeAsync("HorarioItem/Index", new { id = Model.Horarios.Id});
</div>
</div>
But it returns me the following error:
Invalidoperationexception: A view Component named 'Scheduleitem/Index' could not be found. A view Component must be a public non-abstract class, not contain any Generic Parameters, and either be Decorated with 'Viewcomponentattribute' or have a class name ending with the 'Viewcomponent' suffix. A view Component must not be Decorated with 'Nonviewcomponentattribute'.
How can I proceed ? Thank you.
she is a partial view @mariana?
– novic
I’m learning the language now and I’m still picking up a lot, I created the pages with crud Razors, and was created the index page, of item schedule, which is what I need to call.
– Mariana
You need to search on Partial View in Aspnet this is the way, do a Viewcomponent in this case may not be ideal...
– novic
Do you have any material that can help me ? I would have to create another page for partial view ?
– Mariana
For example: https://developmentberto.org/2015/06/04/asp-net-partial-views-razor-mvc-c/ and https://docs.microsoft.com/pt-br/aspnet/core/mvc/views/partial?view=aspnetcore-2.0 this second is the official documentation
– novic
In my look I do not have these options the project is developed in . NET Core 2.0 Utilizo Page Razor
– Mariana
There’s Mariana ... it’s the same
– novic
He gives me the option only to create a Pagerazor, he won’t let me create a VIEW, how weird. As I am new in this specialty, I do not know if it is due core or not.
– Mariana