ImageButton in ASP.NET Repeater does not fire OnClick eventhandler

后端 未结 2 793
栀梦
栀梦 2021-01-16 10:35

I have an ImageButton inside a repeater control. I have attached an eventhandler to the OnClick event of the ImageButton. But when I click the ImageButton the event does not

2条回答
  •  青春惊慌失措
    2021-01-16 10:48

    Inside a repeater control, a button does not behave the same way as out.

    You need to set the "CommandName" property of the button and in the Repeater.ItemCommand event check for that command name and do your logic there.

提交回复
热议问题