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
Prasant Jinaga
1k
751
424.5k
Bind the value to the Model in MVC
Oct 1 2012 2:50 AM
Hi,
I have a grid like structure in one of my page
In my Cshtml,
@Html.TextBoxFor(model => model.PatientPreferences[index].Email, new { @id = "patEmail" + index })
My Problem is,when is click on search button without entering any values it displays all the values and when i change something and click on update its also working fine.but when i enter some first name and click on search It displayed the corresponding row except Email field it remain the first value like '
[email protected]
' For a work around what i did,
i have changed my cshtml to
<input type="text" value="@Model.PatientPreferences[index].Email" />
@Html.TextBoxFor(model => model.PatientPreferences[index].Email, new { style = "display:none", @id = "patEmail" + index })
It works But wont be able to bind it to the model that is why its not updating...
Do anyone faced this problem ever???
Note:It works fine if change it from textbox to lable.
Reply
Answers (
3
)
Barcode and save it in database
Row not adding automatically in datagridview when a data is fetched from other form