Skip to content

Blazor Preview 5 patch examples#37252

Merged
guardrex merged 2 commits into
mainfrom
guardrex/patch-pr
Jun 11, 2026
Merged

Blazor Preview 5 patch examples#37252
guardrex merged 2 commits into
mainfrom
guardrex/patch-pr

Conversation

@guardrex

@guardrex guardrex commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Addresses #37206

Sorry for the delay, Wade! Great catch on those gremlins 😈!

Please go ahead and merge this if it looks good to you.


Internal previews

📄 File 🔗 Preview link
aspnetcore/blazor/components/quickgrid.md aspnetcore/blazor/components/quickgrid

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Blazor QuickGrid documentation samples for .NET 11 Preview 5 by tightening query-string handling and fixing navigation usage in the paging/details examples.

Changes:

  • Update the Details.razor sample to treat Id/Page as nullable query parameters and to generate a “Back to List” link that works when page is missing.
  • Update the SciFiCharacters.razor sample to inject NavigationManager and use the injected instance for navigation.
  • Update the < aspnetcore-11.0 sample to make the Page query parameter nullable.
Comments suppressed due to low confidence (1)

aspnetcore/blazor/components/quickgrid.md:525

  • Page is treated as a 1-based page number, but the code only checks HasValue. If a user supplies ?page=0 (or a negative value), Page.Value - 1 becomes negative and can cause SetCurrentPageIndexAsync to throw. Guard for Page > 0 (or clamp to 1) before subtracting.
    private int? Page { get; set; }

    protected override async Task OnInitializedAsync()
    {
        if (Page.HasValue)

@guardrex guardrex requested a review from wadepickett June 11, 2026 19:23
@guardrex

guardrex commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

Hold a sec ... I like Copilot's remark ...

Page is treated as a 1-based page number, but the code only checks HasValue. If a user supplies ?page=0 (or a negative value), Page.Value - 1 becomes negative and can cause SetCurrentPageIndexAsync to throw. Guard for Page > 0 (or clamp to 1) before subtracting.

UPDATE: Done! 👍

@wadepickett

Copy link
Copy Markdown
Contributor

...reviewing....

monikerRange: '>= aspnetcore-8.0'
ms.author: wpickett
ms.custom: mvc
ms.date: 11/11/2025

@wadepickett wadepickett Jun 11, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ms.date: 06/11/2026

@wadepickett wadepickett left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Approved. I reset the ms.date, becuase I could.

@guardrex guardrex merged commit a947ae0 into main Jun 11, 2026
4 checks passed
@guardrex guardrex deleted the guardrex/patch-pr branch June 11, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants