Note that there are some explanatory texts on larger screens.

plurals
  1. POAjax ConfimButtonExtender firing before OnClientClick javascript code
    primarykey
    data
    text
    <p>Im using aspnet 3.5, vs 2008, ajax 2.0, plain old javascript (not using any javascript framework). </p> <p>In a asp:listview i have a button (delete) with a OnClientClick= "turnrowpink(this);"</p> <p>I also have an ajax 2.0 confirmbuttonextender for this button ( are you sure you want to delete this record? )</p> <p>The turnrowpink function used to run before the are you sure? message. </p> <p>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. </p> <p>I have since added a lot of totally nonrelated javascript functions, and now the above code fires in the reverse order:</p> <p>Are you sure? confirm happens 1st, then <strong>on ok</strong>, 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 <strong>(this)</strong> seems to have been set to something else at that point. </p> <p>So, how to I force turnrowpink to fire first? </p> <p>I realize that stuff is done asynchronously but it used to work.</p> <p>Here's the code :</p> <p>this is in the listview item template : </p> <pre><code>&lt;td&gt; &lt;asp:ImageButton ID="ImageButtonDel" runat="server" OnClientClick="TurnRowPink(this);" ImageUrl="~/delete.GIF" CommandName="DeleteRecord" CommandArgument='&lt;%# Eval("tt_Pkey") %&gt;' /&gt; &lt;/td&gt; </code></pre> <p>and this is the ConfirmButtonExtender, also in the listview item template :</p> <pre><code>&lt;cc1:ConfirmButtonExtender ID="ConfirmButtonExtender1" ConfirmText="Are you sure you want to delete this record?" runat="server" TargetControlID="ImageButtonDel"&gt; &lt;/cc1:ConfirmButtonExtender&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload