I have these two lines in my GET action method:
var model = new CreateNKIphase1ViewModel();
model.SubjectTypeName = goalcard.SubjectType.Name;
I am doing this and using it for a IF statement in my view. Thats why I have this ViewModel property.
I dont want to fill my Model.SubjectTypeName in my POST action method. but when I debugg and try post my form I get following error and its pointed to my if Statement on Model.SubjecTypeName.
Object reference not set to an instance of an object.
Any type of solutions is appreciated.
Thanks in advance
I had this problem before, and I solved it by redirect to another view in my post action.
Make your
Postredirect to another view.