vendredi 17 février 2017

MVC3 Partial view inside another partial view doesn't set model

I've got a partial view named "_Edit"
It is strongly typed, being "RegistryDTO" the model class

At a certain point, "_Edit" renders another strongly typed partial view named "_RelatedRequests", which's model class is simply String, using the following line:

@Html.Partial("_RelatedRequests", model.registryID);

Obviously, registryID is of type String
But for some reason, "_RelatedRequests"'s model is set to null, and any reference to "model" points to it's parent's model ("_Edit"), which obviously is a RegistryDTO object instead of a String one

What could be causing this?

Aucun commentaire:

Enregistrer un commentaire