weimha
asked on
Javascript Delete Confirmation is posting back
I have the have a gridview with the folloiwng command field:
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ButtonType="Button" />
In row_databound I do the following for each row and each delete button:
deleteButton.Attributes.Ad d("onclien tclick","j avascript: return confirm(\"Are you sure you wish to delete this record?\")");
When I run the page and press the delete button, the client side script never gets ran. the page goes throught the postpage and my delete processes are executed?
What am I missing here?
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ButtonType="Button" />
In row_databound I do the following for each row and each delete button:
deleteButton.Attributes.Ad
When I run the page and press the delete button, the client side script never gets ran. the page goes throught the postpage and my delete processes are executed?
What am I missing here?
use "onclick" instead of "onclientclick"
ASKER
The "onclick" shows the delete confirmation, but clicking okay in it does do a post back. My GridView1_RowDeleting is never executed.
Did you add onrowdeleting="GridView1_R owDeleting " in the asp: gridview tag?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window