Skip to content

Instantly share code, notes, and snippets.

@Termiux
Created July 31, 2013 22:46
Show Gist options
  • Save Termiux/6126906 to your computer and use it in GitHub Desktop.
Save Termiux/6126906 to your computer and use it in GitHub Desktop.
This is a simply example of a confirmation box and gridview using jQuery Noty plugin and Asp.Net WebForms
$(document).ready(function () {
$('#MainContent_InsertButton').click(function (e) {
// first we must stop the postback to show this confirmation
e.preventDefault();
noty({
text: 'Insert this data to system?',
buttons: [
{ addClass: 'btn btn-primary', text: 'Ok', onClick: function ($noty) {
// this = button element
// $noty = $noty element
// now close this notification after click
$noty.close();
// do the Insert button postback
__doPostBack('ctl00$MainContent$InsertButton', '')
//noty({text: 'You clicked "Ok" button', type: 'success'});
}
},
{ addClass: 'btn btn-danger', text: 'Cancel', onClick: function ($noty) {
// now close this notification after click
$noty.close();
//noty({text: 'You clicked "Cancel" button', type: 'error'});
}
}
]
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment