简体   繁体   中英

Get value of umbraco datatype in code

I have created a checkbox list type of data type in umbraco. see below screen shot 在此处输入图片说明

I am able to get the text value of this data type which is "All" in this case. But I am unable to get the Value in code.

umbraco.library.IProperty property = node.GetProperty("countries");
string val = property.Value;

I also looked at all the property fields but Value of this is not available. Any one has any idea I am using Umbraco 6.2.4

看来您应该为自己的灵魂使用GetPreValueAsString

string val = umbraco.library.GetPreValueAsString(node.GetProperty<int>("countries"));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM