Confirmation of Delete in datagrid not working
-
Hi, I have a dategrid were i have a link button for delete. In the item data bound i am adding an onclick atribute for the link button to popup the msgbox. In Item command I am writing the logic for delete.. the columns in the grid are dynamically created from the codebehind and not in the design part... My problem is when I click the delete link I am geting the msgbox..If I click ok the page is not posted back to the server and the row is also not deleted... in Item data bound the code is : ((LinkButton)e.Item.Cells[9].Controls[0]).Attributes.Add("onclick","javascript:return ConfirmDelete();"); the javascript added in the .aspx part is : function ConfirmDelete() { if(confirm('Do You Want to Delete?')) { return true; } return false; }
Regards, Sivaprasad
-
Hi, I have a dategrid were i have a link button for delete. In the item data bound i am adding an onclick atribute for the link button to popup the msgbox. In Item command I am writing the logic for delete.. the columns in the grid are dynamically created from the codebehind and not in the design part... My problem is when I click the delete link I am geting the msgbox..If I click ok the page is not posted back to the server and the row is also not deleted... in Item data bound the code is : ((LinkButton)e.Item.Cells[9].Controls[0]).Attributes.Add("onclick","javascript:return ConfirmDelete();"); the javascript added in the .aspx part is : function ConfirmDelete() { if(confirm('Do You Want to Delete?')) { return true; } return false; }
Regards, Sivaprasad