Created
April 10, 2015 14:50
-
-
Save oclockvn/5751d605a0a771136cfe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input type="hidden" id="success" value="@TempData["success"]" /> | |
<input type="hidden" id="info" value="@TempData["info"]" /> | |
<input type="hidden" id="info" value="@TempData["warning"]" /> | |
<input type="hidden" id="error" value="@TempData["error"]" /> | |
<script> | |
$(function () { | |
if ($('#success').val()) { | |
displayMessage($('#success').val(), 'success'); | |
} | |
if ($('#info').val()) { | |
displayMessage($('#info').val(), 'info'); | |
} | |
if ($('#warning').val()) { | |
displayMessage($('#warning').val(), 'warning'); | |
} | |
if ($('#error').val()) { | |
displayMessage($('#error').val(), 'error'); | |
} | |
}); | |
var displayMessage = function (message, msgType) { | |
toastr.options = { | |
"closeButton": true, | |
"debug": false, | |
"positionClass": "toast-top-right", | |
"onClick": null, | |
"showDuration": "300", | |
"hideDuration": "1000", | |
"timeOut": "8000", | |
"extendedTimeOut": "1000", | |
"showEasing": "swing", | |
"hideEasing": "linear", | |
"showMethod": "fadeIn", | |
"hideMethod": "fadeOut" | |
}; | |
toastr[msgType](message); | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment