开发者

List content type by group name

  SPContentTypeCollection ctc=web.ContentTypes;
  string id = string.Empty;
  foreach (SPContentType item in ctc)
  {
    if (string.Equals(item.Group.ToStr开发者_开发百科ing(),"Custom CT"))
    {
      id = item.Id.ToString();
      break;
    }

Why is the id = item.id.tostring() not working. Something's wrong in the if statement.


The code is fine. There was a misspelling for the CT group name that's why I wasn't getting all the content types for that group.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜