The ScriptManager's AllowCustomErrorsRedirect property (which is true by default) determines whether or not to use your custom error settings while performing asyncronous postbacks.