zoukankan      html  css  js  c++  java
  • SharePoint 2010 编程链接两个web part

    1. Get the SPLimitedWebPartManager instance on the page;
    2. Get the provider and consumer Web parts need to be connected;
    3. Get the connection points for the provider and consumer Web parts;
    4. Connect them using SPConnectWebParts method. If necessary, certain transforming needs to be in place for compatible interfaces
    SPWeb web = (SPWeb)properties.Feature.Parent;      
    SPLimitedWebPartManager mgr = web.GetLimitedWebPartManager("default.aspx", PersonalizationScope.Shared);      
    System.Web.UI.WebControls.WebParts.WebPart provider= mgr.WebParts["Provider"];   
    System.Web.UI.WebControls.WebParts.WebPart consumer= mgr.WebParts["Consumer"];  
    ConsumerConnectionPoint addConsumerConnPoint = mgr.GetConsumerConnectionPoints(consumer)["AddressConsumer_ot"];   
    ProviderConnectionPoint addProviderConnPoint = mgr.GetProviderConnectionPoints(provider)["AddressProvider_ot"];      
    mgr.SPConnectWebParts(provider, addProviderConnPoint, consumer, addConsumerConnPoint);
  • 相关阅读:
    周总结5
    《梦段代码》阅读笔记01
    NABCD
    结对开发(四则运算)
    《人月神话》阅读笔记03
    周总结4
    移动端疫情显示
    周总结3
    《人月神话》阅读笔记02
    软件工程第四周作业
  • 原文地址:https://www.cnblogs.com/ahghy/p/3044863.html
Copyright © 2011-2022 走看看