How to use ModelState to clear my form after I post my form data,my view
model is a viewmodel which has two models?
my view model is a viewmodel which has two models,
publish class ViewModel
{
public Student StudentModel{get;set;}
public Teacher TeacherModel {get;set;}
}
I has two forms called StudentForm and TeacherForm,Which binding
StudentModel and TeacherModel respectively.Now I fill in some data in
StudentForm and submit it. I use ModelState.Clear(); to clear my
StudentForm data ,but It seems not only clear the data of the StudentForm
but also the TeacherForm,How can I only clear the data of the StudentForm?
No comments:
Post a Comment