dotnet / dotnet/aspnetcore

Blazor - IsSectionDefined - SectionOutlet has Content

Open
#52,477 4 comments 6 reactions 0 assignees View on GitHub
area-blazor
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 6h
Merged PRs (30d)
290

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

Hello, I´m looking for a way to find out if a SectionOutlet has content.
It could be really helpful to determine if a section has been populated to structure the overall layout.

### Describe the solution you'd like

First option

```html

The content you can set when no Section has been set

```

Second option

```html

@if(_hasContent){

}

The content you can set when no Section has been set

@code{
private SectionOutlet _section;
private bool _hasContent => _section.Content is not null;
}
```

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.