How to prevent “aspxerrorpath” being passed as a query string to ASP.NET custom error pages

后端 未结 11 805
夕颜
夕颜 2020-12-29 03:36

In my ASP.NET web application, I have defined custom error pages in my web.config file as follows:



        
11条回答
  •  礼貌的吻别
    2020-12-29 03:42

    If you want to resolve or handle error request you can insert into Handler try catch statement. like this:

    try {
      //  Block of code that generate error
    }
    catch(Exception e) {
      //  Block of code to handle errors ||| HERE you can put error in your response and handle it without get xhr redirect error.
    }
    

提交回复
热议问题