C # code
try { //бла бла } catch (Exception) { ViewBag.Error = "Возникли проблемы при отправке вопроса!"; } HTML button
<button class="btn btn-primary" type="submit" onclick="Notification"><i class="fa fa-envelope" aria-hidden="true"></i> Отправить</button> Create notification script
<script> function Notification() { if (@ViewBag.Error != null) { $.notify("Вопрос успешно отправлен",{ globalPosition: "top center", // Распологается поцентру className: "success" // Успешное выполнение }); } else { $.notify("Возникли проблемы при отправке вопроса!",{ globalPosition: "top center", // Распологается поцентру className: "error" // Успешное выполнение }); } } </script>
onclick="Notification"=>onclick="Notification()"- Rostyslav Kuzmovychtype="submit"and see what happens - Rostyslav Kuzmovych