Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Dereference of a possibly null when blazor binding to a parameter that may be null?

$
0
0

How do I write the DOM code differently ?

<select readonly disabled class="form-select" @bind="@project.ProgrammeId">            @if (_programmes is not null)            {                @foreach(var x in _programmes)                {<option value="@x.Id">@x.Name</option>                }            }</select>

Receiving a warning on the @bind="@project.ProgrammeId" part pf the above select:"Dereference of a possibly null cpp(CS8602)"

@code{    [Parameter]    public Project? project {get;set;}}

Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>