2010-12-01 95 views
0

有谁知道如何获取内容页的标签名?我知道如何得到身份证,但不知道如何获得名字? 这是我到目前为止的代码:我如何在用户控件中获取标签名称umbraco

int userId = umbraco.BasePages.UmbracoEnsuredPage.GetUserId(umbraco.BasePages.UmbracoEnsuredPage.umbracoUserContextID); 
      DocumentType typeToCreate = DocumentType.GetByAlias("FAQItem"); 

       Document newDoc = Document.MakeNew("test123", typeToCreate, new global::umbraco.BusinessLogic.User(userId), 1161); 
       newDoc.getProperty("yourName").Value = newDoc.getProperty("Question"); 

        foreach(var prop in newDoc.GenericProperties) 
        { 
         newDoc.getProperty("email").Value += prop.PropertyType.TabId + " "; 
        } 

回答

3

我管理的使用.getVirtualTabs一样的,一样的东西:

foreach (var t in dt.getVirtualTabs()) 
{ 
    if (t.Id == id) 
    return t.Caption; 
}