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
Mohit Vijay
NA
67
2.4k
What is best way to update a List
in MVC
Oct 7 2013 2:07 PM
Hello All,
I am developing a web application using MVC 4.0 and C#. I am stuck with a problem, so looking for community help.
Problem Description:
I have a Model Attribute
Example of Property in Attribute
Name, DislayName, Value, IsOptional, HtmlFieldType
You can say these are Attributes of Person Assets, so Model called PersonAsset will have
List<Attribute>, PersonName, PersonId
So I will have list of attributes fields
@foreach(Attribute attr in Model.ListOfAttributes)
{
@Html.TextBoxFor(attr=>attr.value)
@Html.CheckBoxFor(attr=>attr.IsOptional)
}
When I edit textbox value or checkbox value what Is the option I will to update my Model using entered value. Postback is one of the option, but when we have large model, I dont think it will be good option to postback whole module.
using Javascript, we will totally loose unit testable code, but can adopt this, if we have minimum java script involvement.
Please suggest.
Thanks
Reply
Answers (
2
)
how to display an image in asp.net
Bulk Import, Update, Delete from Excel to Sql using asp.net