Asp.net asynchronous loading and asp.net asynchronous loading

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.