We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have a SimplePagination component with just the basics:
SimplePagination
<Pagination> @for ( int i = 0; i <= ( TotalItems / PageSize ); ++i ) { <PaginationItem>@i.ToString()</PaginationItem> } </Pagination> @functions{ [Parameter] int TotalItems { get; set; } [Parameter] int PageSize { get; set; } = 10; }
Use case:
<SimplePagination TotalItems="5" /> <SimplePagination TotalItems="15" /> <SimplePagination TotalItems="45" />
When rendered I get this:
But if I store the page number inside of temp var I get the expected result:
<Pagination> @for ( int i = 0; i <= ( TotalItems / PageSize ); ++i ) { var pageNum = i.ToString(); <PaginationItem>@pageNum</PaginationItem> } </Pagination> @functions{ [Parameter] int TotalItems { get; set; } [Parameter] int PageSize { get; set; } = 10; }
I guess that ChildContent inside of my PaginationItem will only get the reference to the ToString() function instead of it's return value.
ChildContent
PaginationItem
Is this expected behavior ?
The text was updated successfully, but these errors were encountered:
Yes, this is expected. See https://github.com/aspnet/Blazor/issues/1402, https://github.com/aspnet/Blazor/issues/764, https://github.com/aspnet/Blazor/issues/665
Sorry, something went wrong.
Thanks for answering, @campersau!
No branches or pull requests
I have a
SimplePagination
component with just the basics:Use case:
When rendered I get this:

But if I store the page number inside of temp var I get the expected result:
I guess that
ChildContent
inside of myPaginationItem
will only get the reference to the ToString() function instead of it's return value.Is this expected behavior ?
The text was updated successfully, but these errors were encountered: