ITkid
asked on
problem with deleting a row from datagrid after confirmation
hi all ,
i wanted to delete a row from the datagrid after confiramtion .i have used the same way that is given in the below link .
http://builder.com.com/5100-6373-1049811.html#Listing%20E
but the form is being posted even after i click on cancel . can any one pls tell me why this is happening. i have written the delete code both in the ItemCommand and also in deleteCommand function and tried . but the form is begin posted back even after i click on cancel of confirm dialog box .
regards
ITkid.
Show how you are calling the confirmation.
If it is javascript confirmation you have to use the return statement. For example
<a href="link.aspx" onClick="return confirm('Are you sure you want to remove this item?')">delete</a>
This way the link.aspx will only be executed after you click OK in the dialog. So, what does your code look like?
If it is javascript confirmation you have to use the return statement. For example
<a href="link.aspx" onClick="return confirm('Are you sure you want to remove this item?')">delete</a>
This way the link.aspx will only be executed after you click OK in the dialog. So, what does your code look like?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oops I forgot, you will also need the following in the <asp:Datagrid > statement
<asp:DataGrid1 OnItemCommand="DataGrid1_I temCommand "/>
<asp:DataGrid1 OnItemCommand="DataGrid1_I
are you sure you have added this line exectly as it said:
l.Attributes.Add("onclick"
Regards!
B..M