Webforms/MVC hybrid aspx error page being rendered through Razor?

287 Views Asked by At

We have a legacy webforms site that we have "successfully" integrated MVC and Web.Api into. If there are no server errors then all is good, pages render as expected. However if an MVC page gets a server error then it prints garbage.

�����������������

I believe what is happening is that on an error it is attempting to push an aspx server error page through the Razor view engine. Has anyone seen this, and possibly know how to fix it to show the actual lemon meringue server error page?

<customErrors mode="RemoteOnly" defaultRedirect="~/ErrorPages/GeneralErrorPage.aspx">
  <error statusCode="500" redirect="~/ErrorPages/GeneralErrorPage.aspx" />
  <error statusCode="403" redirect="~/ErrorPages/GeneralErrorPage.aspx" />
  <error statusCode="404" redirect="~/ErrorPages/PageNotFound.aspx" />
</customErrors>
0

There are 0 best solutions below