i have this ajax function
<% using (Ajax.BeginForm("UpdateFlags", null,
new RouteValueDictionary(new { Model.ParentId, Model.Page }),
new AjaxOptions() { UpdateTargetId = "testflag123", OnBegin = "flagtest" },
new Dictionary<string, object> { { "data-ajax-mode", "CALLBACK" }, { "data-ajax-update-callback", "updateUploader" }, { "id", "testflag123" } }))
{%>
which goes to the function in the controller that i'm after but when i use the action link it goes somewhere else.
$('.saveFlag').click(function () {
var ai = {
Id: 113,
FlagsId: ["4", "5", "6"]
};
$.ajax({
url: '<%: Url.Action("UpdateFlags", null, new RouteValueDictionary(new {Model.ParentId, Model.Page }))%>',//,("UpdateFlags",new {controller = "BaseDocument", area="MyWealth"})
type: 'POST',
data: ai,
success: function (data) {
alert(data.success);
},
error: function () {
alert("error");
}
});
});
Please advice