I had a question about the command behind ButtonField (image type) in a GridView.
Got a GridView called gvIngevuld in which I show the rows of data and 1 row of ButtonField. Now I have to put the code behind these buttons (each of them is the same) to put some things in PDF format. The problem is that I donβt know how to put the code behind these buttons? The code I have is:
<asp:ButtonField ButtonType="Image" ImageUrl="~/Images/pdf.png" CommandName="pdf_click" />
As you can see, I used the CommandName = "pdf_click" property, but when I click one of the buttons, only the postback appears, but nothing happens. Who can help me here?
if necessary, the code is behind:
protected void pdf_click(object sender, EventArgs e) { lblWelkom.Text = "Succes!"; }
Thanks.
source share