✅ How can i bind a value to an item on render in blazor?
I use the following layout:
But when the user clicks on an item it tries to get next
i
value, for example if a database has 3 items (including null item) i
will be 4, resulting in an IndexOutOfRangeException
. How can i make i
value somehow bind to the item on render in a way that i can get it in code?10 Replies
would a foreach loop fix your issues
not possible, i want to have limitations by the number on items on the page...
a fair enough you can store I in an outisde var and pass that in
Well, it's a work-around i may go with, any other options though?
I think there should be such functionality in blazor
i think just doing this is fine idk an other way
Thanks, this works perfectly!
You could alsu use foreach with var i in Enumerable.Range()
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
Ok, didn't know about this command