Deletion on the ajax callback issue
<p>I have a dashboard in my website which contain some entries in table, each entry in the table have a <code>delete</code> button. When user click over the <code>delete</code> button a Ajax call happens and i am deleting that entry in the callback function. My code :</p>

<pre><code>$(".del").live({
    click: function () {
        $.post("/Home/DeleteTemplate", {
            name: $(this).parent().siblings("td:first").children("a").html()
        }, function (data) {
            $(this).parents("tr").remove(); //Inside the callback
        });
    }
});
</code></pre>

<p>Now my problem is that if i was deleting the row in the callback fuction the row was not removed from the entries immediately. I have to close and open the dashbord again to see the result. </p>

<p>But if i delete the entry outside of the callback function then it removed at the same time : </p>

<pre><code>$(".del").live({
    click: function () {
        $.post("/Home/DeleteTemplate", {
            name: $(this).parent().siblings("td:first").children("a").html()
        });
        $(this).parents("tr").remove(); //Outside the callback   
    }
});
</code></pre>

<p>Whats the problem here?</p>
