I'm currently working on an ASP.NET Core 2.1. RC1 Final (May 2018) demo application. I try to use the new Razor UI Library in my ASP.NET Core MVC application.
Thus, in my Solution I have 2 Projects:
- ASP.NET Core MVC application
- Razor Class Library
The structure of my Razor Class Library is very simple:
- RazorClassLib1
- Areas
- MyFeature
- Pages: Page1.cshtml
- MyFeature
- Areas
The cshtml of Page1.chtml looks like that:
@page
@model RazorClassLib1.MyFeature.Pages.Page1Model
@{
Layout = "_Layout";
}
<h1>Hello From the Razor ClassLib1</h1>
Now I want to use this Page1.cshtml Razor component in my MVC View. This feature would be useful to organize and reuse razor pages within my application.
Unfortunately I have no idea how to achieve this. I was following this example:
http://www.talkingdotnet.com/asp-net-core-2-1-razor-ui-as-class-library/
though it seems to work only for a razor page project, but I would need it in my MVC projct.
Do you know how to use a Razor Class Library in ASP.NET MVC Core 2.1. Views?
Thank you very much.