Controls on webpage:
Datagrid has Delete button:
<asp:ImageButton id="btnDelete" runat="server" CommandName="Delete"></asp:ImageButton>
At function MyDatagrid_ItemCreated , I add attributes to that Delete button. So, when the user click on Delete button, then it's showed a confirmation message before to proceed to delete the record.
Private Sub MyDatagrid_ItemCreated(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles MyDatagrid.ItemCreated
If (e.Item.ItemIndex > -1) Then
Dim mydeletebutton As TableCell
mydeletebutton = e.Item.Cells(0)
mydeletebutton.Attributes.Add("onclick", "return alert('Are you sure you will delete record...?');")
Now my problem is that the user has to write on the TextBox. When user focus on the TextBox and then press ENTER, then it is showed windows message: 'Are you sure you will delete record...?'.
I tried to put hide buttons on the webpage, but no success.
Allways when the user hit ENTER on the TextBox, the message appears on screen.
This function is never raised:
Private Sub MyTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyTextBox.TextChanged
' Some code goes here ....
How could I solve that?