asp.net of asynchronous loading _ practical skills

Source: Internet
Author: User

The specific I probably use there are two kinds, need to cooperate with JQ.

First Kind, request pages directly via Ajax : for example,

1:datatype must be in HTML or text format,

2:type: Must be ' Post ' request

3: The background Load event must determine whether it is a POST request

    

The background code is as follows:

The test results are as follows:

    

The second type is similar to the. NET MVC direct Request method .

1: The background code, the introduction of using System.Web.Services;

2: The method must be a static modification, and the method above is marked with attributes [WebMethod]

3: Returns a successful callback function in JQ must be the return name. D such as: DATA.D

4:ajax, you must specify contenttype: "Application/json;charset=utf-8"

5: If you want to pass parameters, you need to add double quotes, such as: Data: "{' PageIndex ':" + PageIndex + "}"

Multiple formats are so. such as: Data: "{' PageIndex ':" + PageIndex + ", ' pagesize ':" +pagesize+ "}"

The background code is as follows:

        

The foreground code is as follows:

The test results are as follows:

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

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.