I am trying to receive a model in my PartialView
that is within the model of the parent view, it is complicated to explain, I will try to do it with a bit of code
Model A
public class example
{
string var1;
string var2;
}
And i have another model who has example
as property
Model B
public class padre
{
string another_var;
example ejemplo;
}
I'm having issues when i want to recive example
from a padre
view
View
@model padre
<div>@Html.Partial(_PartialViewExample, Model.ejemplo)</div>
PartialView
@model example
@* some coding *@
Thats what i'm trying, but i'm getting a
System.InvalidOperationException
that tells me that the PartialView
expects a example
model and I'm sending it a padre
model
Is the problem understood?
Thanks so much, and sry about my horrible english!