Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>so you want to catch the event before it triggers the server, right?</p> <p>first of all, you need to take the Click event away, use that button as a normal button only, change the current button to:</p> <pre><code>&lt;asp:Button id="btnShowDialog" Text="Delete Event" runat="server" OnClientClick="$('#myDialog').dialog('open');" /&gt; </code></pre> <p>or for this you can use a normal link or html button, instead using the server to create it</p> <pre><code>&lt;input type="button" value"Delete Event" onclick="$('#myDialog').dialog('open');" /&gt; </code></pre> <p>this will open the Dialog:</p> <p>Now, what you need is to place the Button that triggers the server event in the dialog it self!</p> <p>that you can accomplish passing the save javascript that you can find the the browser status bar when you click the button, in other words, do a Post Back using only javascript - You can find the correct code changing Button to LinkButton and mouse over it.</p> <p>change the:</p> <pre><code> "Cancel This Event": function() {$(this).dialog("close");} </code></pre> <p>to:</p> <pre><code>"Cancel This Event": function() { __doPostBack('btnDeleteEvent', ''); } </code></pre> <p>this will do the same as a btnDeleteEvent does, <strong>you do need</strong> to have a LinkButton called this name to actual perform the click behavior (make text = "" so it doesn't show in the page).</p> <pre><code>&lt;asp:LinkButton ID="btnDeleteEvent" runat="server" Text="" onclick="btnDeleteEvent_Click" /&gt; </code></pre> <p>remember to have in the code-behind file the event to be fired up</p> <pre><code>protected void btnDeleteEvent_Click(object sender, EventArgs e) { // do something } </code></pre> <p><strong>Updated</strong></p> <p>added: <a href="http://pastebin.com/f3621e08e" rel="noreferrer">link to the complete source</a></p>
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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