get submit button id

后端 未结 7 731
抹茶落季
抹茶落季 2021-01-21 02:57

Inside asp.net form I have few dynamically generated buttons, all of this buttons submit a form, is there a way to get which button was submit the form in page load event?

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-21 03:28

    You could try:

    if (this.Page.Request.Form[this.btnSave.ClientID.Replace("_", "$")] != null) {
    
    }
    

提交回复
热议问题