TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Marius Vasile
590
1.9k
149k
ASP.NET Core Razor - select from enum shows only value
May 27 2020 1:05 AM
Ok, so I have an enum from which I make a select list. After I save data, on view it display the value (number) and I want to see the text. How do I do that?
public
enum
IsolationType
{
Mechanical = 1,
Electrical = 2
}
<select
class
=
"form-control border-warning"
style=
"font-size:12px"
asp-
for
=
"ICContent.IsoType"
asp-items=
"Html.GetEnumSelectList<IsolationType>()"
>
<option value=
""
>Isolation Type</option>
</select>
<span
class
=
"form-control"
style=
"font-size:12px;"
>@Html.DisplayFor(modelItem => item.IsoType)</span>
Reply
Answers (
5
)
Help me find the problem
taging issue in client side