1. Asp.net project, the frontend uses ajax to transfer values to the backend. How can we determine whether there is a method called to the backend? Set a breakpoint and go away at all, and then there is no problem in returning the result, so just respond to the error method directly. Please give me some advice!
page:
Backstage:
Browser:
response:
When you send an ajax request, specify the data type to be received as
json
而你后端返回的数据不是json
formats. Therefore, it is deemed that the request failed and a failure callback is entered.And there may be something wrong with your back-end writing. The browser's response is an HTML page?
These places should be
response.write('xxxx')
rightThen
response.end()
Let’sShouldn’t all backend response data be
response.write
?Added:
I must have written it wrong
html
test.aspx.cs
ajax removes datatype:json
or Response.Write returns json format data
When returning in the background, change it to: