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
Randy Rutecki
NA
35
3.1k
MVC Data Binding
Jul 8 2017 9:21 AM
I am trying to bind a value from a button to submit to a DB. I see that the view created a way to bind the value to a form textbox:
@Html.EditFor(model => model.TeamNumber, New { htmlAttributes = new { @class = "form-control" } } )
This works great if I wanted to add the TeamNumber in the textbox, but I have a series of buttons with the game schedule of teams for the week and when I click on one I am able to use jQuery to access the teamID's for the teams I want to select but need to save the selected teams to the db.
i have the db and class for 5 teams team1, team2 team3 etc. that I could save using the above binding but I want to know how to take the team1Id value from the button click and bind it to the model as if I had entered it in the text box.
Any help would be greatly appreciated.
Thanks
Reply
Answers (
2
)
difference between Synchronous and Asynchronous Methods as
How do I fetch and display URL post display it on another page