Don't miss out Virtual Happy Hour this Friday (April 26).
Try our conversational search powered by Generative AI!
AI OnAI Off
Don't miss out Virtual Happy Hour this Friday (April 26).
Hi, yes by casting the block to IContent
var content = myBlock as IContent;
if (content != null)
{
var name = content.Name;
}
Or do you mean the type's displayname?
var repo = ServiceLocator.Current.GetInstance<BlockTypeRepository>();
var blockType = repo.Load<T>();
return blockType.DisplayName;
How can I get the displayname of a block in code?