Im using aspnet 3.5, vs 2008, ajax 2.0, plain old javascript (not using any javascript framework).
In a asp:listview i have a button (delete) with a OnClientClick= "turnrowpink(this);"
I also have an ajax 2.0 confirmbuttonextender for this button ( are you sure you want to delete this record? )
The turnrowpink function used to run before the are you sure? message.
It used to be that when the are you sure? would popup, the row that you had clicked on to delete was displayed in pink, to make it obvious which row you were deleting.
I have since added a lot of totally nonrelated javascript functions, and now the above code fires in the reverse order:
Are you sure? confirm happens 1st, then on ok, turnrowpink is called. Kind of silly to run turnrowpink at that point. To add insult to injury, im getting a javascript error on turnrowpink, since the parm (this) seems to have been set to something else at that point.
So, how to I force turnrowpink to fire first?
I realize that stuff is done asynchronously but it used to work.
Here's the code :
this is in the listview item template :
<td>
<asp:ImageButton ID="ImageButtonDel"
runat="server" OnClientClick="TurnRowPink(this);"
ImageUrl="~/delete.GIF" CommandName="DeleteRecord"
CommandArgument='<%# Eval("tt_Pkey") %>' />
</td>
and this is the ConfirmButtonExtender, also in the listview item template :
<cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1"
ConfirmText="Are you sure you want to delete this record?"
runat="server" TargetControlID="ImageButtonDel">
</cc1:ConfirmButtonExtender>