艺海无涯,学无止境。欢迎一起探讨技术和人生,了解我

Umbraco获取Dropdown预设值

 
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
	Layout = "pageMaster.cshtml";
	var dataType = ApplicationContext.Services.DataTypeService.GetDataTypeDefinitionByName("Nav - NavGroup - Dropdown list"); //Dropdown
	var preValuesFromDataType=library.GetPreValues(dataType.Id);
	preValuesFromDataType.MoveNext();
	var myIterator = preValuesFromDataType.Current.SelectChildren("preValue", "");
}
@while (myIterator.MoveNext())
{
	@myIterator.Current.GetAttribute("id", "")  @myIterator.Current.Value
}