I would like to use renderpartial but I'm not so clear on the way it is used. If I just call render partial then is any model sent to that? I want to use the HTML helpers. Is there any difference between using those in renderpartial and in the main razor view?
Asked
Active
Viewed 165 times
1 Answers
0
If the view actually uses a model and you don't provide any, it just end up having a null Model object (so lots of Null Object Reference Exception).
Just go with
@{ Html.RenderPartial("_partialView", PartialViewModel); }
or:
@Html.Partial("_partialView", PartialViewModel)
The differences between the two are indicated here.
HTH, M.