Hi experts,
I want to update the user profile in asp.net MVC but modelstate is not true,
In View Model, I have added all details like
- u_id
- username
- firstname
- lastname
- password
now i only want to update firstname and lastname
I think that's model is not valid
Lkindly give me suggestion/Solution to resolve this


Ketan MokariyaRank #1,793 · 832 reputationPosted Oct 9, 2021, 11:43 AM EDT
You need to update the existing record of the user profile. You can first retrieve that user details from db so that all userprofile model will have data and then set details which you need to update like firstname and lastname and you can save that info.
You can refer following article for CRUD operation.
https://www.c-sharpcorner.com/article/crud-operation-in-asp-net-mvc2/
Sachin SinghRank #66 · 26.2K reputationPosted Oct 10, 2021, 12:55 AM EDT
Srinivasan RamamoorthiRank #877 · 2.5K reputationPosted Oct 10, 2021, 4:58 AM EDT