blazor variable argument passing to onclick function

后端 未结 2 677
轮回少年
轮回少年 2020-12-12 02:22

I want to pass the int i into the button onclick function for each list item. I expected the \"clickItem\" function will receive 0..2 for correspondig list item. But it come

2条回答
  •  轮回少年
    2020-12-12 03:02

    I tried this, and it worked. Hope it seems helpful to you.

     @foreach (var item in ListOfUser)
                {
                    
                        @item.FirstName
                        
                            
                        
                    
                }
    

提交回复
热议问题