Asp.net asynchronous loading and asp.net asynchronous loading
I usually use either of the following two methods: JQ.
First,Directly request the page through AJAX: For example,
1: dataType must be in html or Text format,
2: Type: Must be a 'post' request
3: the backend Load event must determine whether it is a Post request.
The background code is as follows:
The test results are as follows:
The second method is similar to the Direct Request Method of. net MVC.
1: introduce using System. Web. Services in the background code;
2: The method must be static, and the [WebMethod] feature is attached to the method.
3: the data obtained in the callback function returned successfully in JQ must be the return name. d For example: data. d
4: In AJAX, you must specify contentType: "application/json; charset = UTF-8"
5: to pass Parameters, double quotation marks are required, for example, data: "{'pageindex':" + pageIndex + "}"
This is true for multiple formats. For example, data: "{'pageindex':" + pageIndex + ", 'pagesize':" + pagesize + "}"
The background code is as follows:
The front-end code is as follows:
The test results are as follows:
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.