Custom Error Pages with Layout

后端 未结 2 497
忘了有多久
忘了有多久 2021-01-18 18:26

I\'ve been fighting to get custom error pages to work and keep finding my way back to simply using a static page. Though the static page works, it would require remaking the

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-18 18:42

    I struggled with this as well and searched for a long time. As far as I can tell there is no way to create a dynamic custom error page that gets served up for IIS Errors for requests that don't enter the .net pipeline. Like you, I ended up having two 404 error pages. One dynamic .aspx one for file not founds errors resulting from requests that entered the .net pipeline, and one .html one for file not found requests that never entered the .net pipeline. The person who downvoted your question probably didn't realize that you are asking a very good, and difficult question, that has no easy solution. I will upvote your question to help compensate.

提交回复
热议问题