Jquery Noty плагин получить значение подтверждения

После прочтения нескольких постов и попыток заставить мой код работать, мне ничего не помогло. То, что я пытаюсь сделать, это получить возвращаемое значение из ноти, когда пользователь нажимает кнопку "ОК" в диалоговом сообщении. Я хочу получить это значение в коде C# и продолжить с дальнейшей логикой. Messagedialog работает и отображается, как и ожидалось, но я не могу понять, как получить истинное / ложное, когда пользователь нажимает ОК. Заранее спасибо!

<asp:Button ID="btnInactivate" runat="server" Text="Inactivate" OnClick="btnInactivate_Click" Visible="false" CssClass="buttonInactivate"/> 

protected void btnInactivate_Click(object sender, EventArgs e)
{           
    this.ClientScript.RegisterStartupScript(this.GetType(), "script", "confirm_noty();", true);

    var retValue = noty........
    // get the value from noty 
    // button ok pressed ... continue with further process....
}

function confirm_noty() {
 var n = noty({
    layout: 'center',
    type: 'warning',
    text: 'Do you want to inactivate current record?',
    dismissQueue: true,
    theme: 'defaultTheme',
    modal: true,
    buttons: [
           {
               addClass: 'btn btn-primary', text: 'Ok', onClick: function ($noty) {

                   // this = button element
                   // $noty = $noty element

                   $noty.close();
                   noty({
                       dismissQueue: true, force: true, layout: 'center', theme: 'defaultTheme', text: 'Record successfully inactivated.', type: 'success',
                       "animateClose": { "height": "toggle" }, "speed": "550", "timeout": "1200", "closable": true, "closeOnSelfClick": true
                   });
               }
           },
           {
               addClass: 'btn btn-danger', text: 'Cancel', onClick: function ($noty) {
                   $noty.close();
               }
           }
    ]
});

}

0 ответов

Другие вопросы по тегам