Jquery Dialog Confirm not working in Jquery Datatable
<p>Trying to use a jquery dialog confirm to delete records in a jquery datatable.
The delete works on the initial page load, but if I change pages or search the delete link does not work.</p>

<pre><code>&lt;script type="text/javascript"&gt;
$(document).ready(function () {
    $('#dataTable').dataTable({
        "aoColumnDefs": [
        { "bSortable": false, "bSearchable": false, "aTargets": [2] }
        ]
    });

    //modal popup

    $("#dialog-confirm").dialog({
        autoOpen: false,
        resizable: false,
        height: 200,
        width: 400,
        modal: true,
        buttons: {
            "Delete": function () {
                $(this).dialog("close");
                $("form")["delete"].submit();
            },
            Cancel: function () {
                $(this).dialog("close");
            }
        }
    });

    $(".deleteLink").click(function (e) {
        e.preventDefault();
        $("#dialog-confirm").dialog("open");
    });

    //     $.ajaxSetup({ cache: false });

});
</code></pre>

<p></p>

<p>Here is html.</p>

<pre><code>&lt;table cellpadding="0" cellspacing="0" border="0" class="display" id="dataTable"&gt;
&lt;thead&gt;
    &lt;tr&gt;
        &lt;th&gt;
            @Html.LabelFor(p =&gt; Model.FirstOrDefault().LastName)
        &lt;/th&gt;
        &lt;th&gt;
            @Html.LabelFor(p =&gt; Model.FirstOrDefault().FirstName)
        &lt;/th&gt;
        &lt;th&gt;
        &lt;/th&gt;
    &lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
    @foreach (var item in Model)
    {
        &lt;tr&gt;
            &lt;td&gt;
                @Html.DisplayFor(modelItem =&gt; item.LastName)
            &lt;/td&gt;
            &lt;td&gt;
                @Html.DisplayFor(modelItem =&gt; item.FirstName)
            &lt;/td&gt;
            &lt;td&gt;
                @Html.ActionLink("Edit", "Edit", new { id = item.UserId }) |
                @Html.ActionLink("Details", "Details", new { id = item.UserId }) |
                @Html.ActionLink("Delete", "DeleteConfirmed", new { id = item.UserId }, new { @class = "deleteLink" })
                @using (Html.BeginForm("DeleteConfirmed", "User", new { id = item.UserId})){}
            &lt;/td&gt;
        &lt;/tr&gt;
    }
&lt;/tbody&gt;
</code></pre>

<p>
Here is confirm dialog</p>

<pre><code>&lt;div id="dialog-confirm" title="Delete the item?" style="display:none" &gt;  
&lt;p&gt;&lt;span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"&gt;&lt;/span&gt;This item will be deleted. Are you sure?&lt;/p&gt;  
</code></pre>

<p></p>
