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.