Karan Thakkar

Karan Thakkar

  • 1.2k
  • 204
  • 90k

how to handle null values of models in mvc?

Jun 3 2019 7:35 AM
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)