tags:

views:

226

answers:

0

So I'm submitting an Ajax.ActionLink with HttpMethod = "POST" and it works great. However, as soon as I specify an AjaxOptions.OnSuccess callback it submits with "GET" and does a full post back because Request.IsMvcAjaxRequest() is no longer true. Is this a bug or am I doing something wrong here? I'm using the latest Beta version.

Works:

<%= Ajax.ActionLink("delete", "Delete", "Kind", new { id = kind.ID}, 
                        new AjaxOptions { 
                            HttpMethod = "POST",
                            Confirm = "Are you sure you want to delete this Kind? This will delete any associated inventory items as well."
                        }, new { @class = "delete" }) %>

Doesn't Work:

<%= Ajax.ActionLink("delete", "Delete", "Kind", new { id = kind.ID}, 
                        new AjaxOptions { 
                            HttpMethod = "POST",
                            Confirm = "Are you sure you want to delete this Kind? This will delete any associated inventory items as well.",
                            OnSuccess = "KindIndex.itemDeleted"
                        }, new { @class = "delete" }) %>