Im trying to list all the values in my checkbox list and If they're checked i need to wrap them in a div with the class "gotvalue". I found this code below, which just lists all my values. Im not sure on how to proceed from here - Got any suggestions?
@{
var dataType = ApplicationContext.Services.DataTypeService.GetDataTypeDefinitionByName("Diet Direction");
var preValues = ApplicationContext.Services.DataTypeService.GetPreValuesCollectionByDataTypeId(dataType.Id).PreValuesAsDictionary.Select(x => x.Value).ToList();
var allTags = preValues;
}
@foreach (var item in allTags)
{
if(@item.Value != null) {
<div class="gotvalue"><a href="@item.Value">@item.Value</a></div>
}
else {
<div class="gotnovalue"><a href="@item.Value">@item.Value</a></div>
}
}
Checklist values
Hey guys,
Im trying to list all the values in my checkbox list and If they're checked i need to wrap them in a div with the class "gotvalue". I found this code below, which just lists all my values. Im not sure on how to proceed from here - Got any suggestions?
You have to compare with checked option of your content, something like this
is working on a reply...