e.CommandArgument for asp button is not working

前端 未结 4 539
孤独总比滥情好
孤独总比滥情好 2020-12-18 19:41

I am developing a asp.net application using C#. I created an .aspx page and placed four buttons on different locations on the page. On server side, I want to use just one cl

4条回答
  •  有刺的猬
    2020-12-18 20:14

    Actually you don't need to pass the CommandArgument at all to know which button you pressed. You can get the ID of the button like below:

    string id = ((Button)sender).ID;
    

提交回复
热议问题