locked
Handling ArgumentException: Illegal characters in path RRS feed

  • Question

  • User1880253885 posted

    How can I handle URLs with illegal characters such that they don't throw an unhandled exception? I tried an HttpModule but that doesn't catch the error. I'm using IIS6 and .Net 2.0.

    Thursday, September 16, 2010 4:02 PM

Answers

  • User1546878023 posted

    Depending on the error message you get, it sounds like an error you can't fix. It sounds like an error thrown by the IIS before any user code is executed, and therefore you cannot handle the error

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 17, 2010 5:17 PM

All replies

  • User1546878023 posted

    Depending on the error message you get, it sounds like an error you can't fix. It sounds like an error thrown by the IIS before any user code is executed, and therefore you cannot handle the error

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, September 17, 2010 5:17 PM
  • User-975492262 posted

    Any solution for this issue? I am facing same problem.

    I got an MVC applciation where in user enters a URL say, example.com/client.site/__.ashx

    But if he enters illegal characters like example.com/cleint.site/_||_.aspx

    it throws illegal characters in the path. I added global.asax and handled it in application_error and redirecting it to cusotm error page.

    If i enter some thing like this:  example.com/client.s||ite/__.ashx, then again the same error is displaying. I want to handle it by redirecting it to custom error page. Any solution please guide me.

    Monday, February 28, 2011 7:10 AM