Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I interrupt an ASP.NET button postback with BlockUI and Jquery
    text
    copied!<p>I have an ASP.NET page with a number of ASP:Button instances on it. For some, I need to show a confirmation prompt and, should the user choose yes, the original postback method is called. Otherwise, the overall process is cancelled.</p> <p>I've got an example running but I get inconsistent results, mainly in FF3 where I get an exception thrown:</p> <pre><code>[Exception... "Illegal operation on WrappedNative prototype object" nsresult: "0x8057000c (NS_ERROR_XPC_BAD_OP_ON_WN_PROTO)" location: "JS frame :: </code></pre> <p>I've looked this error up but I'm drawing a loss as to where I'm going wrong. Here's my example case. Note, for now I'm just using the css class as a lookup. Longer term I can embed the clientID of the control into my JS if it proves necessary :).</p> <p>Html fragment:</p> <pre><code>&lt;asp:Button ID="StartButton" runat="server" CssClass="startbutton" Text="Start" OnClick="OnStartClicked" /&gt; </code></pre> <p>Javascript:</p> <pre><code>$(".startbutton").each(function(){ $(document).data("startclick", $(this).get()[0].click); $(this).unbind("click"); }).click(function(){ var oldclick = $(document).data("startclick"); alert("hello"); try { oldclick(); } catch(err) { alert(err); alert(err.description); } return false; }); </code></pre> <p>My code behind is relatively simple, the OnStart method simply executes a Response.Write</p> <p>I've only just started looking into bind, unbind and trigger so my usage here is pretty much 'first time'.</p> <p>Thanks for any help or advice.</p> <p>S</p> <p>EDIT:</p> <p>This describes what I'm trying to do and also gives a run down of the kind of pitfalls:</p> <p><a href="http://www.nabble.com/onClick-prepend-td15194791s27240.html" rel="nofollow noreferrer">http://www.nabble.com/onClick-prepend-td15194791s27240.html</a></p>
 

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