Layout not rendered when using await IncludeAsync using .NET Core 3
See original GitHub issueDescribe the bug Layout not being rendered when using await IncludeAsync using .NET Core 3.
To Reproduce The following code does not render the layout.
@inherits RazorLight.TemplatePage<MyModel>
@{
Layout = "_Layout.cshtml";
}
<p>
@{
await IncludeAsync("_LetterHeader.cshtml", Model);
}
</p>
Note that MyModel implements an interface that is accepted by _LetterHeader.cshtml, but I assume that this is not the issue as the letter header renders fine.
The following does render the layout.
@inherits RazorLight.TemplatePage<MyModel>
@{
Layout = "_Layout.cshtml";
}
<p>Hello</p>
Expected behavior The layout should be rendered when using await IncludeAsync.
Information (please complete the following information):
- OS: Windows 10
- Platform: .NET Core 3.0
- RazorLight version: current branch as at 28/11/2019
- Visual Studio version: Visual Studio Community 2019 16.3.4
Additional context None
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:30 (13 by maintainers)
Top Results From Across the Web
c# - Use of await in Razor views
There is a trick you can use to sort of implicitly load data async into the View. First, you define a class that...
Read more >view Component rendered early not waiting for await ...
Hi I am using first time view Component in my Dotnet core application to get API result data to view. I have created...
Read more >RazorLight
Use Razor to build templates from Files / EmbeddedResources / Strings / Database or your custom source outside of ASP.NET MVC. No redundant...
Read more >Using Async, Await, and Task to keep the WinForms UI ...
Using the async/await pattern in WinForms is an easy win, helping prevent one of the most annoying user experiences - a frozen UI....
Read more >Asynchronous Programming with Async and Await in ASP. ...
In this article we are going to learn how to use async and await keywords in ASP.NET Core, making the solution more scalable....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe I have successfully created a Pull Request. Please let me know if that is how you wanted it done. thanks.
Hi all, the Layout is also not rendering on ASP.NET Core 2.2 project.
@jzabroski any timeline to fix this issue or workaround that I can implement?
Information (please complete the following information):
OS: Windows 10 Platform: ASP.NET Core 2.2 RazorLight version: 2.0.0-beta.4 Visual Studio version: Visual Studio Pro 2019 16.4.0