开发者

How do i get the tab name in a usercontrol umbraco

Does anyone know how to get the tabname of a contentpage? I know how to get the id but not how to get the name? This is my code so far:

 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)
                    {
                        newDo开发者_StackOverflowc.getProperty("email").Value += prop.PropertyType.TabId + " ";
                    }


I managed the same using .getVirtualTabs, something like:

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜