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
599
1.9k
142.9k
asp.net core selectlist to show multiple text values
Jan 23 2021 4:21 PM
I have a table with 3 entries in addition to the Id. I want a select list to show all entries in a row, for better identification of the data. Right now select only show me either the value (Id) or one text(one field) from table
ex.
<select id=
"Location"
class
=
"form-control border-warning"
asp-items=
"Model.Locations"
>
<option value=
""
>--Select Asset Location--</option>
</select>
In the table I have the following fields Id, Location, City, Country
Locations = await _context.WOAssetLocations.Where(s => s.OrgID == orgid)
.Select(s =>
new
SelectListItem
{
Value = s.WOALId.ToString(),
Text = s.AssetLocation
}).ToListAsync();
get me only one field, depending on my choice, either Location, City or Country. This is good but the select I want to show in a row all values coresponding to Id
Reply
Answers (
4
)
Consume API with parameter on POST
About Session or Cookies