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);


            }

  • 相关阅读:
    Fiddler界面详解
    Windows平台下Java,tomcat安装与环境配置
    为什么要装Tomcat?
    实例五租房子
    实例四投票
    易犯的PHP小错误及相应分析
    MYSQL数据库错误代码提示汇总
    php mysql_insert_id()
    实例三搜索
    实例二增删改查
  • 原文地址:https://www.cnblogs.com/chenfulai/p/1142279.html
Copyright © 2011-2022 走看看