Open haykpetros opened 1 year ago
Hi @mkArtakMSFT I am tagging you here hopping you can help to bump this up, as this issue hasn't been updated or commented for a while now, and I am not sure if this is due to me not reporting it properly or maybe something else.
I saw you commenting on something related to RCL as well (Issue #53285), so that is why decided to tag you hopping that you can help in moving this forward.
Hey @haykpetros did you ever get this figured out?
We ran into a similar problem and we needed to add a _ViewImports.cshtml
to the RCL project under the Pages folder and add the tag helpers there as well via @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
Hey @haykpetros did you ever get this figured out?
We ran into a similar problem and we needed to add a
_ViewImports.cshtml
to the RCL project under the Pages folder and add the tag helpers there as well via@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
Hi @jeffpapp the issue we discovered is that when using await Html.PartialAsync(...)
everything works as expected, so if you have <partial name="...">
in your RCL view you will need to replace it with Html.PartialAsync(...)
. I didn't have time, but planning to test this with latest .NET 9 preview and if this bug is still there report it into .NET 9 branch as advised by @mkArtakMSFT
Is there an existing issue for this?
Describe the bug
When referencing Razor Class Library (RCL) Partial View from ASP.NET Razor Pages app, nested views of RCL are not being rendered when using
<partial name="...">
tag helper, but will render just fine when usingawait Html.PartialAsync(...)
Here is the screenshot that shows the behavior of the test solution that is attached to this issue:
In short, following code:
and this one:
behave differently, when to the best of my understanding they should not. In fact, they behave same way when used directly in Razor Pages web application.
This was tested with .NET 7 and .NET 8 RC2.
WebApplication1.zip
Expected Behavior
According to the documentation (https://learn.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/built-in/partial-tag-helper?view=aspnetcore-8.0) the Partial Tag Helper
<partial>
and the HTML Helper options for rendering a partial view@await Html.PartialAsync
should behave the same.Steps To Reproduce
Use attached sample solution to see the behavior.
WebApplication1.zip
Exceptions (if any)
No response
.NET Version
.NET 8 RC2
Anything else?
No response