Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Hide value of enum from the html (UI)

$
0
0

I have an enum type like:

    public enum EntryState
    {
        Proposed = 0x0001,
        Canceled = 0x0002,
            Approved = 0x0004,    // for compatibility only!
        [Display(Name = "--Authorized--")]
        Authorized = 0x0004,
        Repproved = 0x0008,
        All= Proposed| Canceled | Authorized | Repproved
    }

and I render it in the html as:

@Html.DropDownListFor(m => m.AppStateData.state, Html.GetEnumSelectList<EntryState>(), new { @class = "dstate-control" })

This will show the values in the enum, including 2 with the same value (Approved , Authorized ).

However, I only include Approved for compatibility, and I wouldn't like to render this tag in the html (UI).

Could you help me?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>