In my project, I have got a partial view with the following block of code doing some conditions like this:
@if (!string.IsNullOrEmpty(Model.FirstName)) {
<h3> @Model.FirtsName </h3>
}
Just as simple as that. When I run my project, a null model is returned. I get the following error:
Cannot perform runtime binding on a null reference
I thought I had already defined this in my if statement.
Is there anything that I am missing?
@fromModeland then make sureModelis not null