-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
[Parameter] is necessary also for [SupplyParameterFromQuery] #31554
Comments
🎉🥳 Happy New Year! 💃🕺A green dinosaur 🦖 will be along shortly to assist. Stand-by ........ |
Not strictly necessary AFAIK. Let's ping @MackinnonBuck ... Should the guidance add a line that says something like ...
... and then I can add a little example like ... [Parameter]
[SupplyParameterFromQuery]
public string? Filter { get; set; } |
On my side - using .NET 7.0.15 - on a normal page (not a component), I used the "SupplyParameterFromQuery" to get an int? parameter from query. It does not work, and I had to google for a while to figure out the reason. Than I spotted out, in other examples, there is the "Parameter" also. After added it to my property into my page, than it started to work fine. |
I don't understand. This API is only for Razor components AFAIK. Mackinnon, one of our TOP product unit engineers will be along in a bit to take a look at this and advise further. I'll email him, too, to make sure he gets the ping. He usually responds by EOD unless he's OOF. Stand-by ....................... |
Ah, yep. Before .NET 8, both AFAICT, the docs are correct - the .NET 8 page omits the @guardrex, do you think it would make sense to add a note in the .NET 8 version of the docs to clarify that when using a version earlier than .NET 8, the |
Yes ... that's right about not adding it to the reference doc. I'll place a section on this in the Migration article. We mostly avoid doing it in the reference docs because they would eventually be filled with thousands of little "this changed in version X" remarks. |
Description
In the section "Query strings", information is missing. "SupplyParameterFromQuery" does not stand alone, [Parameter] attribute is also necessary. Without it, the parameter from the query will not be processed.
Page URL
https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/routing?view=aspnetcore-8.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/fundamentals/routing.md
Document ID
b6cb2574-6326-a40d-0b6c-d1661328e828
Article author
@guardrex
The text was updated successfully, but these errors were encountered: