The Wayback Machine - https://web.archive.org/web/20220128093226/https://github.com/dotnet/aspnetcore/issues/39830
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Sections dosen't populate from partials. #39830

Open
1 task done
ParadiseFallen opened this issue Jan 28, 2022 · 0 comments
Open
1 task done

[BUG] Sections dosen't populate from partials. #39830

ParadiseFallen opened this issue Jan 28, 2022 · 0 comments

Comments

@ParadiseFallen
Copy link

@ParadiseFallen ParadiseFallen commented Jan 28, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When partial contains

// partial view
// some html markup
@section [SectionName]
{
  [SectionBody]
}

([SectionBody] and [SectionName] are placeholders)
And then use this partial as

// Index.cshtml
// some html markup
<partial name="[PartialName]" />
@section [SectionName]
{
  [SectionBody]
}

and render it in _Layout
then in _Layout will be partial & index HTML markup BUT there will be ONLY SectionName from Index.cshtml and no from partial.

Expected Behavior

Sections from partials must be rendered in _Layout same as sections from pages.
In attached repo on page must be extra Partial loaded h1 text.

Steps To Reproduce

https://github.com/ParadiseFallen/AspNetCore.RazorPages.SectionIssue

Exceptions (if any)

No response

.NET Version

6.0.101

Anything else?

.net 6.0
aspnetcore 6
VS 2022

output of dotnet --info :
Version: 6.0.101
Commit: ef49f6213a

OS Name: Windows
OS Version: 10.0.19043
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.101\

Host (useful for support):
Version: 6.0.1
Commit: 3a25a7f1cc

.NET SDKs installed:
5.0.402 [C:\Program Files\dotnet\sdk]
6.0.100 [C:\Program Files\dotnet\sdk]
6.0.101 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.11 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant