zoukankan      html  css  js  c++  java
  • 在Feature中写的代码

           public override void FeatureActivated(SPFeatureReceiverProperties properties)
            {

                SPWeb site = ((SPSite)properties.Feature.Parent).RootWeb;
                SPFile page = site.GetFile("Pages/TimerSettings.aspx");
                SPLimitedWebPartManager mgr;
                mgr = page.GetLimitedWebPartManager(PersonalizationScope.Shared);
                // add Web Part to Right Zone
                ImageWebPart wp1 = new ImageWebPart();
                wp1.ChromeType = PartChromeType.None;
                wp1.ImageLink = @"/_layouts/images/IPVW.GIF";
                mgr.AddWebPart(wp1, "TopZone", 0);

                ListViewWebPart lvwp = new ListViewWebPart();
                lvwp.ListName = site.GetList("/Lists/MyLog").ID.ToString("B").ToUpper();
                lvwp.Hidden = false;
                lvwp.ViewGuid = site.GetList("/Lists/MyLog").DefaultView.ID.ToString("B").ToUpper();
                lvwp.ViewType = ViewType.Html;
     
                mgr.AddWebPart(lvwp,"TopZone",1);


            }

  • 相关阅读:
    tkinter_战队数据查询系统
    python_tkinter组件
    python_tkinter基本属性
    python_tkinter组件摆放方式
    python_推导式
    python_装饰器
    python_模块1
    python_生成随机验证码
    linux基础_使用指令3
    linux部署django项目流程(全)
  • 原文地址:https://www.cnblogs.com/chenfulai/p/1142279.html
Copyright © 2011-2022 走看看