Several Methods for ajax asynchronous data loading in SharePoint

Source: Internet
Author: User

At the beginning of the company, I switched from the original asp.net development to the SharePoint SP development. I personally feel that it is not much different from the previous one. I encountered some problems when I used sp to asynchronously load data, jquery was used in the next step in asp.net. ajax +. ashx is implemented. However, when creating an item under the sp, you can create an existing ashx page. There are several ways to asynchronously load data under the sp:

1. create a MyModule class to implement IHttpModule. configure the node in config, add event processing in it, and add the class MyHandler to implement the IHttpHandler interface. Then the corresponding request path can be processed by the MyHandler class.

2. The use of WebPart has not been studied in detail. The visual test is to write a control to implement the requested data, which requires in-depth understanding...

3. Using the sp js object model is not very clear. After all, it takes only two days to get started with sp.

4. the simplest and easiest to understand. 650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/20052QE2-0.gif "/> Create an application page, delete all asp: Content nodes under the aspx page, that is, the front-end has no Content) and the Code is as follows:

protected void Page_Load(object sender, EventArgs e){     string type = Request.QueryString["type"].ToString().Trim();     if (string.IsNullOrEmpty(type))     {          Response.End();          return;      }      switch (type) {          case "11":              Response.Write("1111111");              Response.End();              return;          case "22":              Response.Write("2222222");              Response.End();              return;          default:              Response.End();              return;     }}

What do you understand? 650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/20052TC3-1.gif "/>




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.