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
Benmakhlouf Saad
NA
134
13.1k
MVC : Display Value Insteadof The Id
Mar 31 2020 8:51 AM
Hi,
I want to Display Username instead of Userid but it should take the Userid Value
I have 2 tables : AspNetUsers and AspNetUserRoles
ViewData[
"UserId"
] =
new
SelectList(_context.AspNetUsers,
"Id"
,
"Id"
);
<div
class
=
"form-group"
>
<label asp-
for
=
"UserId"
class
=
"control-label"
></label>
<select asp-
for
=
"UserId"
class
=
"form-control"
asp-items=
"ViewBag.UserId"
></select>
</div>
Reply
Answers (
2
)
Click event on name(suresh) not working
Registration A Data in table.