_PopupError.cshtml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. @model Exception
  2. <div class="errorPopupContainer">
  3. <script>
  4. $(document).ready(function () {
  5. var errorContainer = $(".errorPopupContainer");
  6. if (errorContainer.length > 1) {
  7. for (var i = 0; i < errorContainer.length - 1; i++) {
  8. $(errorContainer[i]).remove();
  9. }
  10. }
  11. });
  12. </script>
  13. @Html.DevExpress().PopupControl(p =>
  14. {
  15. p.Name = "devPopupControlErrorBox";
  16. p.HeaderText = "Fehler bei Aktion";
  17. p.ShowHeader = true;
  18. p.ShowFooter = false;
  19. p.Modal = true;
  20. p.Width = new Unit(500, UnitType.Pixel);
  21. p.MinHeight = new Unit(200, UnitType.Pixel);
  22. p.ShowOnPageLoad = true;
  23. p.SetContent(() =>
  24. {
  25. ViewContext.Writer.Write(
  26. "<div style=\"padding: 16px\">" +
  27. "Leider ist folgender Fehler aufgetreten beim Versuch die " +
  28. "Aktion durchzuführen:<br /><br />" +
  29. "<div id=\"errorContent\" style=\"color: red; font-style: italic\">" + Model.Message +
  30. "</div><br />" +
  31. "Der Fehler wurde protokolliert und kann von Ihrem Systemadministrator " +
  32. "eingesehen werden." +
  33. "</div>"
  34. );
  35. Html.RenderPartial(
  36. "~/Views/Shared/_PopupButtonPanelOption.cshtml",
  37. new GreenTree.Nachtragsmanagement.Web.Models.Global.OptionDialogModel
  38. {
  39. OptionItems = new List<GreenTree.Nachtragsmanagement.Web.Models.Global.OptionDialogItemModel>
  40. {
  41. new GreenTree.Nachtragsmanagement.Web.Models.Global.OptionDialogItemModel
  42. {
  43. Name = "ErrorAccept",
  44. Text = "Ok",
  45. Function = "function (s, e) { devPopupControlErrorBox.Hide(); }"
  46. }
  47. }
  48. }
  49. );
  50. });
  51. p.CloseAction = CloseAction.CloseButton;
  52. p.PopupHorizontalAlign = PopupHorizontalAlign.WindowCenter;
  53. p.PopupVerticalAlign = PopupVerticalAlign.WindowCenter;
  54. p.Styles.Content.Paddings.Padding = new Unit(0, UnitType.Pixel);
  55. p.Styles.ModalBackground.Opacity = 0;
  56. }).GetHtml()
  57. </div>