Hiding the stacktrace for an exception returned by a asp.net WebMethod?
问题 I am using methods with the Attribute [WebMethod] in my aspx pages. I don't use any asp.net ajax but jQuery to call these methods and return objects in JSON. This all works fine. Next I added an authorization check inside the webMethod, if the current user doesn't have access to the feature I need to let the calling JavaScript know. So I am throwing an AccessViolationException exception which can then be parsed by the OnError callback function in JavaScript. This works too but the exception