I have a list that displays the topics of the subscription forums, and on each line there is a button to unsubscribe. I work fine using Ajax to unsubscribe, but I want to upgrade using Ajax to remove the canceled stream from the list. Can someone please suggest me. My code is as follows:
The idea of using Ajax is that I just want to update the list section of an entire page.
index.aspx
<% foreach (var thread in Model.threads) { %>
<tr>
<td><%: thread.Title %></td>
<td><%: Ajax.ActionLink("Unsubscribe", "ToggleForumAlertFromList",
new { id = thread.ForumId },
new AjaxOptions { HttpMethod = "POST",
UpdateTargetId = "none",
new { ID = "togglealertlink" })%>
</td>
</tr>
<% } %>
controller
[HttpPost]
public ActionResult ToggleThreadAlertFromList(Guid id)
{
return new EmptyResult();
}
source
share