@*   Xafari Framework version : 17.2.3011.1336   *@

@using DevExpress.ExpressApp.Web
@using View = DevExpress.ExpressApp.View

@{
    Layout = "~/Views/MVCx/Shared/_ErrorLayout.cshtml";
    ViewBag.Title = "Application Error -" + (MvcApplication.Instance != null ? MvcApplication.Instance.Title : "No application");
}

<div id="PageContent" class="PageContent DialogPageContent">
    <div class="Header">
        <table cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td class="ViewCaption">
                    <h1>
                        @(MvcApplication.Instance != null ? MvcApplication.Instance.Title : "No application")
                    </h1>
                </td>
                <td class="InfoMessagesPanel"></td>
            </tr>
        </table>
    </div>
    <table class="DialogContent Content" border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
            <td class="ContentCell">
                <table id="Table1" width="100%" border="0px" cellpadding="0" cellspacing="0">
                    <tr id="TableRow2">
                        <td id="ViewSite">
                            <h2 id="FormCaption">
                                Application Error
                            </h2>
                            @{
                                var alertSent = (bool)(ViewData["AlertSent"] ?? false);
                                if (alertSent)
                                {
                                    <b>Your report was sent. Thank you.</b>
                                    <br />
                                }

                                var errorInfo = ErrorHandling.GetApplicationError();
                                if (errorInfo != null)
                                {
                                    <div id="ErrorPanel" width="100%">
                                        <p class="StaticText">
                                            <asp:PlaceHolder ID="ApologizeMessage" runat="server">
                                                We are currently unable to serve
                                                your request:&nbsp;<asp:HyperLink ID="RequestUrl" runat="server">RequestUrl</asp:HyperLink>.<br />
                                                We apologize, but an error occurred and your request could not be completed.<br />
                                            </asp:PlaceHolder>
                                            You could go&nbsp;<a href="javascript:history.go(-1)">back</a>&nbsp;and try again
                                            @if (!string.IsNullOrWhiteSpace(errorInfo.UrlReferrer))
                                            {
                                                @:, or return to the <a href="@errorInfo.UrlReferrer">previous page</a>
											}
                                            , or go to the <a href="@AjaxMvcShowViewStrategy.BuildNewRequestThreadUrl((View) null)">home</a> page with new request thread.
                                        </p>
                                        @if (!alertSent)
                                        {
                                            if (ErrorHandling.CanShowDetailedInformation)
                                            {
                                                <div id="Details" width="100%">
                                                    <a style="text-decoration: underline;" id="ShowErrorDetails" href="javascript:;">
                                                        Show/Hide
                                                        Error details
                                                    </a>
                                                    <div id="DetailsContent" style="display: none;">
                                                        <span class="StaticText" style="font-weight: bold;">
                                                            Error details<hr width="100%" />
                                                        </span>
                                                        <pre class="ErrorDetails">@errorInfo.GetTextualPresentation(true)</pre>
                                                    </div>
                                                </div>
                                            }
                                            using (Html.BeginForm("SendAlertToAdmin", "Application"))
                                            {
                                                <div id="ReportForm" width="100%">
                                                    <span class="StaticText" style="font-weight: bold;">
                                                        Report error<hr width="100%" />
                                                    </span>
                                                    <p class="StaticText">
                                                        This error has been logged. If you have additional information that you believe
                                                        may have caused this error please report the problem.
                                                    </p>
                                                    <table cellpadding="0" cellspacing="0" border="0">
                                                        <tr>
                                                            <td align="right" style="padding-bottom: 10px">
                                                                @Html.TextArea("description", "", 8, 60, null)
                                                            </td>
                                                        </tr>
                                                        <tr>
                                                            <td align="right">
                                                                <button id="ReportButton" type="submit">
                                                                    Send Report
                                                                </button>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </div>
                                            }
                                        }
                                    </div>
                                }
                            }
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <script type="text/javascript">
        $("#ShowErrorDetails").click(function () {
            $('#DetailsContent').toggle();
        });
    </script>
</div>
