get submit button id

后端 未结 7 716
抹茶落季
抹茶落季 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条回答
  •  无人及你
    2021-01-21 03:28

    please try this code in page load event

    string eventtriggeredCategory = Request.Form["ctl00$ContentPlaceHolder1$ddlCategory"];
    

    if eventtriggeredCategory is returning any value its fired the event of ddlCategory

    this is works fine for me

    Thanks Jidhu

提交回复
热议问题