1

我有一个主要网站集,它使用红色的股票发布网站模板。所有子站点都继承母版页和主题。所有子站点都使用项目站点模板。我正在使用服务器对象模型创建这些。所有子站点都是创建后的标准蓝色。我怎样才能强迫他们变红?

static void SetupNewSubSite(int currentYear, SPItemEventProperties properties, int siteIndexId)
{
    string description = properties.AfterProperties["Project_x0020_Description"].ToString();
    SPListItem CurrentItem = properties.ListItem;
    String subSiteUrl = Convert.ToString(siteIndexId);
    SPSite projectSiteCollection = new SPSite(properties.Web.Site.Url + "/" + currentYear);           
    SPWeb sWeb = new SPSite(properties.SiteId).OpenWeb(properties.RelativeWebUrl);            
    SPWeb oWeb = projectSiteCollection.RootWeb;
    SPWebCollection cWebs = oWeb.Webs;
    SPWeb xWeb = cWebs.Add(subSiteUrl, properties.AfterProperties["Title"].ToString(),
    properties.AfterProperties["Project_x0020_Description"].ToString(), 1033, "{B5B6BDD1-485A-44BC-B093-F1048271C49D}", false, false);
}
4

0 回答 0