.net - Could not Update data using asp mvc Entity-Framework -


as beginner asp .net mvc m trying update database using entity framework id null make modelstate non valide code of controller

enter image description here

your id equal null because model binder doesn't find value posted data.

to solve must add id hidden field view. in edit.cshtml add following line :

@html.hiddenfor(model => model.id) 

Comments

Popular posts from this blog

routing - AngularJS State management ->load multiple states in one page -

python - GRASS parser() error -

json - Gson().fromJson(jsonResult, Myobject.class) return values in 0's -