In the late maintenance of a project WebForm encountered a relatively large pit, front desk Ajax request, failed to pop background custom error message responsetext. Results in the local runtime can normally eject "Captcha error", and published to the server ResponseText has become the system error message processing, a bunch of error page code, "Captcha error" was replaced. Initial suspicion is the customererror off problem with config configuration, and there is no time to test for confirmation.
In fact, this is an unnecessary pit, 1, is not necessary in the background to return the system error information, but the use of custom JSON data form to encapsulate their own execution results and data to use, in the Ajax success based on the custom status code to determine whether the success, Do not add business logic judgments to system errors. 2, step back in a simple and low way, using the original return system errors, and directly in the AJAX error write dead a pop-up error message, without the server to return data.
Front desk
Background
Ajax Response System error responsetext a bunch of code appears