How to implement AJAX asynchronous load data in SharePoint

Source: Internet
Author: User
Tags object model

First to the company, from the original ASP.net development turned to SharePoint (SP) development, personal feeling and before the difference is small, today with the implementation of the SP asynchronous load data encountered a problem, before the ASP.net next is to use Jquery.ajax +. Ashx to achieve , but when creating items under the SP Wood has found that there are ashx pages can be created, that SP how to implement asynchronous loading data in the following ways:

1. Create the MyModule class to implement IHttpModule excuses and configure the node under the main Web.config, add event handling inside, add the class MyHandler implement the IHttpHandler interface, and then the corresponding request path can be handled by the MyHandler class.

2. The use of WebPart, specifically not in-depth study, the visual is to write a control to achieve the requested data, to be further understanding ...

3. Use SP JS object model, this is not very clear, after all, just contact SP only 2 days.

4. The simplest and easiest to understand the new application page, delete all the asp:content nodes under the ASPX page (that is, the front end has no content), and then 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
          "one":
              Response.Write ("1111111");
              Response.End ();
              return;
          Case "":
              Response.Write ("2222222");
              Response.End ();
              return;
          Default:
              Response.End ();
              return;
     }

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/web/sharepoint/

Related Article

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.