Closed Yustie closed 10 years ago
It seems that this does work:
new AjaxOptions { HttpMethod = "POST", OnSuccess = "window.location.reload(true)", Confirm = "test"
But this is inside the AjaxOptions
. So how come the fluent api function Confirm()
doesn't work?
Never mind, the problem was caused by this script:
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
which also catches the click events of data-ajax-*
classes.
Glad you could figure it out while I was out of town!
Hi,
Somehow my modal popup is not firing any more. Not sure if it was because of the last update, but this is the line:
@dd.AjaxActionLink(Resources.Objects.Cancel, "Update", "Home", new AjaxOptions { HttpMethod = "POST", OnSuccess = "window.location.reload(true)" }).Confirm(Resources.Form.ConfirmCancel).RouteValues(new { pId = item.Id, status = Status.Cancelled, @type = RoleType.Customer }).PrependIcon("glyphicon glyphicon-remove")
This is the generated html:
<a data-ajax="true" data-ajax-method="POST" data-ajax-success="window.location.reload(true)" data-bmvc-confirm="true" data-bmvc-confirm-text="You sure you want to cancel?" href="/Home/Update?pId=35&status=Cancelled&type=Customer"><i class="glyphicon glyphicon-remove">
It goes straight to the controller, it does try to show the modal, but it's like it's getting interrupted before it can be displayed.
if I remove the
RouteValues()
, the modal does get displayed. But then it doesn't do much.