E
EMW
My datagrid has four template columns in which an ImageButton is created.
I use the following to add the OnClick event to the button.
img.Attributes.Add("OnClick", "AllButtons_Click")
The AllButtons_Click sub is:
Sub AllButtons_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim Btn As System.Web.UI.WebControls.Button = sender
Response.Write("You clicked button " & Btn.CommandArgument)
End Sub
But this sub is not run, I get an error telling me AllButtons_Click is not
defined.
Can anyone help me with this?
thanks,
Eric
I use the following to add the OnClick event to the button.
img.Attributes.Add("OnClick", "AllButtons_Click")
The AllButtons_Click sub is:
Sub AllButtons_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim Btn As System.Web.UI.WebControls.Button = sender
Response.Write("You clicked button " & Btn.CommandArgument)
End Sub
But this sub is not run, I get an error telling me AllButtons_Click is not
defined.
Can anyone help me with this?
thanks,
Eric