Use quickpart to implement webpart connection

Source: Internet
Author: User
I believe you have read what I wrote.ExploitationQuickpartQuick CustomizationWebpart AndExploitationQuickpartEasy to developWebpartAttribute Two articlesArticleLater, I will be more interested in this article. Now let's proceed to the subject:

FirstDemoDirectly add a user control namedRecivefolderurlcontrol

Then return to the page and addGridviewClick, add reference, and selectMicrosoft. Sharepoint. dll, The file path is inC: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ ISAPI

After adding the component, rememberCodePage ImportMicrosoft. Sharepoint. dllCompile a static method in this code page.Recivefolderurl ().Remember to declare this method as the data receiver above this method[Connectionconsumor].

Then return Treeviewcontrol Code Page, write a response String Type Method Sendfolderurl Also, remember to declare that the eating method is the data provider. [Connetionprovider]

The code in this chapter is compiled, and remember to goReceviefolderurlcontrolSource code page, click File->Advanced save options->

Source code page:

 

SelectedUTF-8Encoding format (to prevent control display garbled characters)

 Click "project generation" and return to the website page to refresh.ConsumorAddReceviefoldercontrolControl, click application.

In Provider Click to edit -> Connect -> Consumor. Click application.

Finally, refresh the page to see the effect.

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.