5
Answers

how to handle null values of models in mvc?

Karan Thakkar

Karan Thakkar

5y
5.6k
1
I am having a view in that I search student details and bind it in partail view.
In partail view data is bind through a Model.
Model is empty when page load that's why its thorws null refernce error on page load.
So on pagle load my model is null.
I am calling partial view pop up through jquery ajax.
So how to assign some deafults values to that model so ot doesn;t throw error 
Answers (5)