Custom Error Handling in web.config / Global.asax not handling non-existant directory

后端 未结 4 893
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-30 12:09

Question is: Why is custom Error handling not working for non-existing paths/directories?

Updated with fixed code (thanks to everyone for you input):

4条回答
  •  北海茫月
    2020-12-30 12:43

    I can't find the source material for this but I believe the problem lies in the fact it is handling custom error pages and not paths.

    You investigation suggests you came across this, inasmuch as:

    www.mysite.com/nonexistingpath/nonexistingpage.aspx
    

    This ought to hit the correct error page. The following won't:

    www.mysite.com/nonexistingpath/
    

    This kind of reiterates you already answering your own question, but I'll see if I can find the reference material. Ultimately, it isn't a page request, so there is no ISAPI handling through appropriate handlers.

提交回复
热议问题