@model Exception

<div class="errorPopupContainer">
	<script>
		$(document).ready(function () {
			var errorContainer = $(".errorPopupContainer");
			if (errorContainer.length > 1) {
				for (var i = 0; i < errorContainer.length - 1; i++) {
					$(errorContainer[i]).remove();
				}
			}
		});
	</script>

	@Html.DevExpress().PopupControl(p =>
	{
		p.Name = "devPopupControlErrorBox";
		p.HeaderText = "Fehler bei Aktion";
		p.ShowHeader = true;
		p.ShowFooter = false;
		p.Modal = true;
		p.Width = new Unit(500, UnitType.Pixel);
		p.MinHeight = new Unit(200, UnitType.Pixel);
		p.ShowOnPageLoad = true;
		p.SetContent(() =>
		{
			ViewContext.Writer.Write(
				"<div style=\"padding: 16px\">" +
					"Leider ist folgender Fehler aufgetreten beim Versuch die " +
					"Aktion durchzuführen:<br /><br />" +
					"<div id=\"errorContent\" style=\"color: red; font-style: italic\">" + Model.Message +
					"</div><br />" +
					"Der Fehler wurde protokolliert und kann von Ihrem Systemadministrator " +
					"eingesehen werden." +
				"</div>"
			);
			Html.RenderPartial(
				"~/Views/Shared/_PopupButtonPanelOption.cshtml",
				new GreenTree.Nachtragsmanagement.Web.Models.Global.OptionDialogModel
				{
					OptionItems = new List<GreenTree.Nachtragsmanagement.Web.Models.Global.OptionDialogItemModel>
					{
						new GreenTree.Nachtragsmanagement.Web.Models.Global.OptionDialogItemModel
						{
							Name = "ErrorAccept",
							Text = "Ok",
							Function = "function (s, e) { devPopupControlErrorBox.Hide(); }"
						}
					}
				}
			);
		});
		p.CloseAction = CloseAction.CloseButton;
		p.PopupHorizontalAlign = PopupHorizontalAlign.WindowCenter;
		p.PopupVerticalAlign = PopupVerticalAlign.WindowCenter;
		p.Styles.Content.Paddings.Padding = new Unit(0, UnitType.Pixel);
		p.Styles.ModalBackground.Opacity = 0;
	}).GetHtml()
</div>