I want to conditionally hide the elements in the EnumDropDownListFor
based on if the user is logged in or not.
Enum
public enum SortType
{
[Display(ResourceType = typeof(NavigationItems), Name = "BestMatch")]
Best_Match = 0,
[Display(ResourceType = typeof(NavigationItems), Name = "Alphabetical")]
Alphabetical,
[Display(ResourceType = typeof(NavigationItems), Name = "PriceAsc")]
PriceAsc,
[Display(ResourceType = typeof(NavigationItems), Name = "PriceDesc")]
PriceDesc
}
The items I am looking to hide are PriceAsc
& PriceDesc
I have tried looking into the AutoGenerateFilter
and AutoGenerateField
properties to no avail.
View
@Html.EnumDropDownListFor(x => x.sortType, new { id = "orderResults" })