How can I make ASP.NET PageMethods fail on unauthorized (401.2) rather than returning a success with an error page?

66 Views Asked by At

I have an ASP.NET legacy app that uses WebMethods called from the auto-generated PageMethods. I don't really understand why they don't fail when the user is unauthorized (401.2). The method returns to the "success" callback but gives me the html content of a 401.2 error page.

How can I make the PageMethods fail (failedCallback) rather than returning an error page to the 'succeededCallback'?

0

There are 0 best solutions below