Calling a functon in code behind by using an imagebutton in a gridview

后端 未结 2 986
暖寄归人
暖寄归人 2021-01-28 22:57

I have an ImageButton within a GridView in .aspx on clicking this ImageButton i have to call a function. This is how i tried and

2条回答
  •  长发绾君心
    2021-01-28 23:17

    Because you are wrapping your ImageButton inside of a Hyperlink, the browser is probably going to the hyperlink's URL instead of posting back to hit the OnClick function. You should have the DeleteUrlImageButton_Click function call Server.Transfer or Response.Redirect to the appropriate URL and get rid of the Hyperlink.

提交回复
热议问题