I'm trying cause a javascript confirmation box to pop up when a user clicks the 'update' button in my editable data field. I searched through the other posts on the topic, but I'm still having problems.
One method I've seen suggested is to use FindControl("btnName") in the ItemDataBound event and then use Attributes.Add.etc. my update button is in an EditCommandColumn and I see no way to name it. Is it possible to name the button so that I can use FindControl("...")?
The other method I read about was to use e.Item.Cells[x].Controls[1] instead of FindControl. I tried this, but it gives me an out of range error for Cells[x]. (if i use Cells[7], i get the cell before the button, but Cells[8] gives the out of range error). Doesn't an editCommandColumn count as a column???
I would like to keep the buttons in an EditCommandColumn if possible. Can someone help me out?
Thanks.
One method I've seen suggested is to use FindControl("btnName") in the ItemDataBound event and then use Attributes.Add.etc. my update button is in an EditCommandColumn and I see no way to name it. Is it possible to name the button so that I can use FindControl("...")?
The other method I read about was to use e.Item.Cells[x].Controls[1] instead of FindControl. I tried this, but it gives me an out of range error for Cells[x]. (if i use Cells[7], i get the cell before the button, but Cells[8] gives the out of range error). Doesn't an editCommandColumn count as a column???
I would like to keep the buttons in an EditCommandColumn if possible. Can someone help me out?
Thanks.