Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 688 Bytes

MA0122.md

File metadata and controls

22 lines (18 loc) · 688 Bytes

MA0122 - Parameters with [SupplyParameterFromQuery] attributes are only valid in routable components (@page)

Component parameters can only receive query parameter values in routable components with an @page directive.

@code {
    // non-compliant as there is no @page
    [Parameter, SupplyParameterFromQuery]
    public int Value { get; set; }
}
@page "/"
@code {
    // ok
    [Parameter, SupplyParameterFromQuery]
    public int Value { get; set; }
}

ASP.NET Core Blazor routing and navigation - Query strings