使用jQuery的恢复功能确认消息

使用jQuery的恢复功能确认消息,jquery,modal-dialog,Jquery,Modal Dialog,我有一个恢复电子邮件模板的按钮。因此,您可以选择是否要恢复原始模板,或者继续使用默认模板中的更改。此时将显示确认对话框。但是如果我点击cancel,那么模板也会变成它原来的默认值,不一定是 这是按钮的jQuery: window.location.href = '@Url.Action("Wijzigen", "EmailTemplate", new { area = "Salaris", id = Model.Id, orgToepassen = true })&type=' + '

我有一个恢复电子邮件模板的按钮。因此,您可以选择是否要恢复原始模板,或者继续使用默认模板中的更改。此时将显示确认对话框。但是如果我点击cancel,那么模板也会变成它原来的默认值,不一定是

这是按钮的jQuery:

 window.location.href = '@Url.Action("Wijzigen", "EmailTemplate", new { area = "Salaris", id = Model.Id, orgToepassen = true })&type=' + '@(Model.Type)';
 @ButtonHelper.Button(ButtonType.Default, ButtonSize.Large, "Herstel standaard mail", id: "herstel-standaard", icon: "glyphicon-refresh")
这是确认对话框的jQuery:

  $('#herstel-standaard').click(function () {
            if (window.confirm('Weet u het zeker?')) {
                $('#content').load($(this).attr('href'));
            }


            window.location.href = '@Url.Action("Wijzigen", "EmailTemplate", new { area = "Salaris", id = Model.Id, orgToepassen = true })&type=' + '@(Model.Type)';
        });
这是按钮的HTML:

 window.location.href = '@Url.Action("Wijzigen", "EmailTemplate", new { area = "Salaris", id = Model.Id, orgToepassen = true })&type=' + '@(Model.Type)';
 @ButtonHelper.Button(ButtonType.Default, ButtonSize.Large, "Herstel standaard mail", id: "herstel-standaard", icon: "glyphicon-refresh")