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
Alexander Bank
NA
17
529
asp-for select selected by database data & post
Jun 5 2018 2:46 AM
Hello friends,
I am new with asp. My project is a small ERP-system with database connection.
I have a page which loads data from various Tables and shows it in Inputs and Selects with dropdowns. If I hit the edit button the edit page loads fine an the dropdown fields are loaded from the database. but they are not preselected to the value of the record that is to be edited.
1. How to preselect the select field from the actual value of the database record?
2. How to write the value of the select back to database?
cshtml.cs file:
cshtml file excerpt with country list loaded from database to a select (works fine):
excerpt form index page (to the right you see the edit (ändern) button:
excerpt from page as it looks like (Ändern means edit in german):
Thank you all for your support. Please excuse errors, it is my first question here. I already googled a long time for help on that issue before aksing question here.
Reply
Answers (
2
)
How to Open Menu Links inside Bootstrap Collapse
Auto increment in mvc